Rob Anderton rob-at-thewebfellas

View rack.rb
1 2 3 4 5 6 7 8 9 10
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
View paired.rb
1 2 3 4 5 6 7 8 9 10
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'
View new_s3_gem_and_other_fixes.diff
1 2 3 4 5 6 7 8 9 10
From 007fcd79294ebcb97c5e0beb25a65c24928812cf Mon Sep 17 00:00:00 2001
From: Rob Anderton <rob.anderton@thewebfellas.com>
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
View paperclip.rb
1 2 3 4 5 6 7 8 9 10
# 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>",
View _run_first.rb
1
Dir[File.join(Rails.root, 'lib', 'patches', '**', '*.rb')].sort.each { |patch| require(patch) }
View modules.rb
1
ActiveRecord::Base.send(:include, TheWebFellas::HasDeletableAttachment)
View track.rb
1 2 3 4 5 6 7 8 9 10
class Track < ActiveRecord::Base
#
# All the usual stuff
#
 
before_save :update_mp3_info
 
#
# More stuff
#
Something went wrong with that request. Please try again.