Skip to content

Instantly share code, notes, and snippets.

View jherdman's full-sized avatar

James Herdman jherdman

View GitHub Profile
(~/dev/project)→ rake cucumber --trace CUCUMBER_OPTS=--verbose
(in /Users/james/dev/thescore)
** Invoke cucumber (first_time)
** Invoke cucumber:ok (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
# Interpolated Symbol names
>> animal = "cow"
=> "cow"
>> :"#{animal}_burger"
=> :cow_burger
class Dog
attr_writer :year_of_birth
def age
def self.age; @age; end
@age = Time.now.year - year_of_birth
end
end
/Users/james/dev/braintree_ruby/lib/braintree/ssl_expiration_check.rb:29:in `initialize': wrong number of arguments (3 for 0) (ArgumentError)
from /Users/james/dev/braintree_ruby/lib/braintree/ssl_expiration_check.rb:29:in `new'
from /Users/james/dev/braintree_ruby/lib/braintree/ssl_expiration_check.rb:29:in `qa_expiration_date'
from /Users/james/dev/braintree_ruby/lib/braintree/ssl_expiration_check.rb:9:in `check_dates'
from /Users/james/dev/braintree_ruby/lib/braintree.rb:55
from /Users/james/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Users/james/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from ./spec/unit/braintree/../../spec_helper.rb:10
from ./spec/unit/braintree/../spec_helper.rb:1:in `require'
from ./spec/unit/braintree/../spec_helper.rb:1
#!/usr/bin/ruby
#
# I deliberately didn't DRY /usr/local references into a variable as this
# script will not "just work" if you change the destination directory. However
# please feel free to fork it and make that possible.
#
# If you do fork, please ensure you add a comment here that explains what the
# changes are intended to do and how well you tested them.
#
# 14th March 2010:
amadeus:~/Sites/scrapbook→ sudo ./bootstrap.sh
================================================================================
Found an existing Narwhal/Cappuccino installation, /usr/local/narwhal. Remove it automatically now?
WARNING: the ENTIRE directory, /usr/local/narwhal, will be removed (i.e. 'rm -rf /usr/local/narwhal').
Be sure this is correct. Custom modifications and installed packages WILL BE DELETED.
Enter "yes" or "no":
yes
================================================================================
Narwhal JavaScript platform is required. Install it automatically now?
Enter "yes" or "no":
// In Crockford-JS, I'd do something like this...
var myFunction = function (args) {
var foo
, bar
, baz;
// function body...
}
##
# Helpers for mocking and stubbing using RR
module MockingAndStubbingHelper
# @param [#new] model The model class that you wish to have a stubbed instance of
#
# @return An instance of the provided model that quacks like an existing record
def stub_model(model)
stub(instance = model.new) do
new_record? { false }
end
PHRASE = '"([^"]+)"'
POSITION = "(?:st|nd|rd|th)"
require 'whenever/capistrano'
##
# Force Whenever to use the Capistrano stage. We use a lambda to delay execution
# until absolutely necessary.
set :whenever_command, lambda { "whenever --set environment=#{fetch(:stage, 'production')}" }