Skip to content

Instantly share code, notes, and snippets.

View practicingruby's full-sized avatar

Gregory Brown practicingruby

View GitHub Profile
require "minitest/autorun"
# inspired by some code from Chris Wanstrath (shared w. me by Ryan Smith)
# https://gist.github.com/25455
#
# heavily modified by Gregory Brown at this point..
def context(*args, &block)
return super unless (name = args.first) && block
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
$ spork --bootstrap
NOTE: Gem.latest_load_paths is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.latest_load_paths called from /Users/seacreature/.rvm/gems/ruby-1.9.2-p180/gems/spork-0.8.5/lib/spork.rb:112.
NOTE: Gem.all_partials is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.all_partials called from /Users/seacreature/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:600.
undefined method `specifications' for "/Users/seacreature/.rvm/gems/ruby-1.9.2-p180":String (NoMethodError)
/Users/seacreature/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:425:in `block in each_load_path'
/Users/seacreature/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:423:in `each'
/Users/seacreature/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:423:in `each_load_path'
/Users/seacreature/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:587:in `block in latest_load_paths'
$ ack Gem
features/steps/rails_steps.rb
13: FileUtils.ln_sf(ENV["BUNDLE_GEMFILE"], "Gemfile")
14: FileUtils.ln_sf(ENV["BUNDLE_GEMFILE"] + ".lock", "Gemfile.lock")
features/support/bundler_helpers.rb
6: command = "env RUBYOPT= BUNDLE_GEMFILE=Gemfile bundle install"
13: gemfile_lock = dir + "/Gemfile.lock"
14: gemfile = dir + "/Gemfile"
18: puts "Gemfile #{gemfile} has changed since it was locked. Re-locking..."
seacreature:spork-testing$ spork
NOTE: Gem.latest_load_paths is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.latest_load_paths called from /Users/seacreature/.rvm/gems/ruby-1.9.2-p180/gems/spork-0.8.5/lib/spork.rb:112.
NOTE: Gem.all_partials is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.all_partials called from /Users/seacreature/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:600.
undefined method `specifications' for "/Users/seacreature/.rvm/gems/ruby-1.9.2-p180":String (NoMethodError)
/Users/seacreature/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:425:in `block in each_load_path'
/Users/seacreature/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:423:in `each'
/Users/seacreature/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:423:in `each_load_path'
/Users/seacreature/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:587:in `block in latest_load_paths'
@practicingruby
practicingruby / test_helper.rb
Created July 5, 2011 13:40
Collection of test helpers for MiniTest
require "minitest/autorun"
require "set"
FIXTURE_DIR = File.expand_path(
File.dirname(__FILE__)+"/fixtures/")
# adopted from: https://gist.github.com/839034
def context(*args, &block)
return super unless (name = args.first) && block
#include<stdio.h>
#if !defined(__LP64__)
#define IS_64 0
#else
#define IS_64 1
#endif
main()
{
class MyCollection
def initialize
@data = []
@data.extend(MySpecialFeatures)
end
def some_method
@data.use_one_of_my_features
end
end
# Is this a bug or just a behavior change? Know a workaround to get the 1.8 behavior in 1.9?
I would even be okay with explicitly having to define inspect as long as
I could get the original inspect behavior from Object back, but would prefer something simpler...
## Ruby 1.9.2
>> class A
>> def initialize(x,y,z)
>> @x, @y, @z = x,y,z
>> end
class Point
def initialize(x,y)
@x, @y = x, y
end
end
module Positionable
attr_accessor :map
def neighbors