This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is a configurable version of an EventMachine syslogger | |
# It was build to replace https://github.com/melito/em-syslog | |
# | |
# You can instantiate many of them (no global variables) as | |
# well as configure the facility. It also quacks like a ruby | |
# logger so it can be interchanged with a ruby logger. | |
# | |
# Example: | |
# | |
# # 11 is the facility code for an FTP daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'integration_helper' | |
require 'rack' | |
require 'rack/handler/webrick' | |
describe HttpClient do | |
before :all do | |
@server = WEBrick::HTTPServer.new( | |
:Port => 9293, | |
:Logger => Rails.logger, | |
:AccessLog => Rails.logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Post | |
include Mongoid::Document | |
field :title, :type => String | |
has_many :comments do | |
def update(selector, params) | |
@target.each { |t| t.update_attributes(params) if t.matches?(selector) } | |
end | |
end | |
end | |