Skip to content

Instantly share code, notes, and snippets.

View JonRowe's full-sized avatar
💭
⛵️

Jon Rowe JonRowe

💭
⛵️
View GitHub Profile
/Users/jrowe/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/core_ext/time/calculations.rb:101:in `advance': undefined method `advance' for #<Date 2010-09-08> (NoMethodError)
from /Users/jrowe/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/time_with_zone.rb:316:in `method_missing'
from /Users/jrowe/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/time_with_zone.rb:242:in `advance'
from /Users/jrowe/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/duration.rb:91:in `block in sum'
from /Users/jrowe/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/duration.rb:86:in `each'
from /Users/jrowe/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/duration.rb:86:in `inject'
from /Users/jrowe/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/duration.rb:86:in `sum'
from /Users/jrowe/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/duration.rb:62:in `since'
from /U
From c389e8dabd9bf6c5ede8191eb6c453407b92442b Mon Sep 17 00:00:00 2001
From: Jon Rowe <mail@jonrowe.co.uk>
Date: Fri, 10 Sep 2010 16:28:23 +0100
Subject: [PATCH] write in binmode if the object is binary encoded
---
lib/dragonfly/temp_object.rb | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/dragonfly/temp_object.rb b/lib/dragonfly/temp_object.rb
Process: Google Chrome [1043]
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Identifier: com.google.Chrome
Version: 6.0.472.62 (472.62)
Code Type: X86 (Native)
Parent Process: launchd [93]
Date/Time: 2010-09-22 11:42:38.799 +0100
OS Version: Mac OS X 10.6.4 (10F569)
Report Version: 6
~$ rvm gemset create new_gemset
'new_gemset' gemset created (/Users/jrowe/.rvm/gems/ruby-1.9.2-p0@new_gemset).
~$ rvm use 1.9.2@new_gemset
Using /Users/jrowe/.rvm/gems/ruby-1.9.2-p0 with gemset new_gemset
~$ gem list
*** LOCAL GEMS ***
rake (0.8.7)
rdoc (2.5.11)
@JonRowe
JonRowe / rspec_core_230_patch_jonrowe_14122010.diff
Created December 14, 2010 15:08
RSpec-Core 2.3.0 autotest failed spec regular expression fix for colour
From fa82095f0928decfeead82341959d7e451fd16aa Mon Sep 17 00:00:00 2001
From: Jon Rowe <mail@jonrowe.co.uk>
Date: Tue, 14 Dec 2010 15:01:10 +0000
Subject: [PATCH] add spec for checking coloured output and regular expression that matches both coloured and non coloured output
---
lib/autotest/rspec2.rb | 2 +-
spec/autotest/failed_results_re_spec.rb | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletions(-)
@JonRowe
JonRowe / async_rack_cache.rb
Created December 16, 2010 16:40
Async rack cache monkey patch.... use with caution
require 'async-rack'
require 'rack/cache'
module Rack::Cache
class Context
include AsyncRack::AsyncCallback::Mixin
def async_callback(result)
response = Response.new(*result)
@request ||= Request.new(env.dup.freeze)
store response if response.cacheable?
@JonRowe
JonRowe / .autotest
Created January 14, 2011 15:40
A generic rails .autotest mappings file
egin
require 'autotest/fsevent'
rescue LoadError
end
Autotest.add_hook :initialize do |at|
at.add_mapping(/^spec\/**\/*_spec\.rb$/, true){ |filename, _|
filename
}
@JonRowe
JonRowe / embedded_document_problem_spec.rb
Created February 2, 2011 16:30
embedded_document_problem_spec.rb
require 'spec_helper'
class Thing
include Mongoid::Document
field :name
embedded_in :person, inverse_of: :things
end
if expand('%') =~# '_spec\.rb$'
syn keyword rubyRspec describe context it specify it_should_behave_like before after setup subject its shared_examples_for shared_context let
endif
hi def link rubyRspec Function
@JonRowe
JonRowe / webmock_synchrony_time_out_issue.rb
Created May 20, 2011 13:42
Proof of concept for fix for double fiber resume error with em-synchrony and webmock
require "em-synchrony"
require "em-synchrony/em-http"
require 'webmock'
include WebMock::API
stub_request(:get, "http://www.gooogle.com/").to_timeout
EM.synchrony do
# pass a callback enabled client to sync to automatically resume it when callback fires