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
module Rack | |
module Utils | |
def parse_query(qs, d = nil) | |
params = {} | |
(qs || '').split(d ? /[#{d}] */n : DEFAULT_SEP).each do |p| | |
k, v = p.split('=', 2).map { |x| unescape(x) } | |
if cur = params[k] | |
if cur.class == Array | |
params[k] << v |
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
c = Mongo::Connection.paired([['localhost', 27017], ['localhost', 27018]]) | |
=> #<Mongo::Connection:0x1016c2418 @size=1, @checked_out=[], @connection_mutex=#<Mutex:0x1016c2300>, @logger=nil, @id_lock=#<Mutex:0x1016c22d8>, @options={}, @sockets=[], @nodes=[["localhost", 27017], ["localhost", 27018]], @timeout=5.0, @port=nil, @queue=#<ConditionVariable:0x1016c2238>, @auths=[], @slave_ok=nil, @host=nil, @safe_mutex=#<Mutex:0x1016c2260>> | |
c.database_info | |
Mongo::ConnectionFailure: Failed to connect socket: getaddrinfo: nodename nor servname provided, or not known | |
from /usr/local/ruby-1.8.6-p383/lib/ruby/gems/1.8/gems/mongo-1.0/lib/../lib/mongo/connection.rb:548:in `checkout_new_socket' | |
from /usr/local/ruby-1.8.6-p383/lib/ruby/gems/1.8/gems/mongo-1.0/lib/../lib/mongo/connection.rb:582:in `checkout' | |
from /usr/local/ruby-1.8.6-p383/lib/ruby/gems/1.8/gems/mongo-1.0/lib/../lib/mongo/connection.rb:578:in `synchronize' |
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
From 007fcd79294ebcb97c5e0beb25a65c24928812cf Mon Sep 17 00:00:00 2001 | |
From: Rob Anderton <[email protected]> | |
Date: Tue, 30 Mar 2010 16:44:52 +0100 | |
Subject: [PATCH 1/5] fix problems with newer versions of test/unit | |
--- | |
test/helper.rb | 3 +++ | |
1 files changed, 3 insertions(+), 0 deletions(-) | |
diff --git a/test/helper.rb b/test/helper.rb |
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
# S3 backend for paperclip plugin. Copy the file to: | |
# +config/initializers/+ directory | |
# | |
# Example configuration for CNAME bucket: | |
# | |
# has_attached_file :image, | |
# :s3_host_alias => "bucket.domain.tld", | |
# :url => ":s3_alias_url", | |
# :styles => { | |
# :medium => "300x300>", |
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
Dir[File.join(Rails.root, 'lib', 'patches', '**', '*.rb')].sort.each { |patch| require(patch) } |
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
ActiveRecord::Base.send(:include, TheWebFellas::HasDeletableAttachment) |
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 Track < ActiveRecord::Base | |
# | |
# All the usual stuff | |
# | |
before_save :update_mp3_info | |
# | |
# More stuff | |
# |