Permalink
Browse files

Updated to be compatible with Ruby 1.9.x

  • Loading branch information...
1 parent 0a542e5 commit 69b3aa3934a0ff376347299af391443a1bdf1fa9 @markbates markbates committed Jul 9, 2010
View
@@ -12,7 +12,7 @@
# Called when the irb session is ready, after any external libraries have been loaded. This
# allows the user to specify which gadgets in the utility belt to equip. (Kind of pushing the
# metaphor, but hey, what the hell.)
- IRB.conf[:IRB_RC] = lambda do
+ IRB.conf[:IRB_RC] = proc do
UtilityBelt.equip(:defaults) unless UtilityBelt.equipped?
UTILITY_BELT_IRB_STARTUP_PROCS.each {|symbol, proc| proc.call}
end
@@ -2,7 +2,7 @@
# Mike Clark's find() shortcut for Rails console
# Creates shortcut methods for finding models.
-UTILITY_BELT_IRB_STARTUP_PROCS[:define_model_find_shortcuts] = lambda do
+UTILITY_BELT_IRB_STARTUP_PROCS[:define_model_find_shortcuts] = proc do
if defined? ActiveRecord::Base || defined? ActiveResource::Base
model_files = Dir.glob("app/models/**/*.rb")
table_names = model_files.map { |f| File.basename(f).split('.')[0..-2].join }
@@ -32,7 +32,7 @@ class InteractiveEditor
end
it "should complain" do
- lambda do
+ proc do
InteractiveEditor.sensible_editor
end.should raise_error
end
@@ -10,13 +10,13 @@
@one2five.map(&'x -> x + 1').should eql(@one2five.map { |x| x + 1 })
@one2five.map(&'x -> x*x').should eql(@one2five.map { |x| x*x })
@one2five.inject(&'x y -> x*y').should eql(@one2five.inject { |x,y| x*y })
- 'x y -> x**y'.to_proc()[2,3].should eql(lambda { |x,y| x**y }[2,3])
- 'y x -> x**y'.to_proc()[2,3].should eql(lambda { |y,x| x**y }[2,3])
+ 'x y -> x**y'.to_proc()[2,3].should eql(proc { |x,y| x**y }[2,3])
+ 'y x -> x**y'.to_proc()[2,3].should eql(proc { |y,x| x**y }[2,3])
end
it "should handle chained arrows" do
- 'x -> y -> x**y'.to_proc()[2][3].should eql(lambda { |x| lambda { |y| x**y } }[2][3])
- 'x -> y z -> y**(z-x)'.to_proc()[1][2,3].should eql(lambda { |x| lambda { |y,z| y**(z-x) } }[1][2,3])
+ 'x -> y -> x**y'.to_proc()[2][3].should eql(proc { |x| proc { |y| x**y } }[2][3])
+ 'x -> y z -> y**(z-x)'.to_proc()[1][2,3].should eql(proc { |x| proc { |y,z| y**(z-x) } }[1][2,3])
end
it "should handle the default parameter" do
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "utility_belt"
- s.version = "1.0.7"
+ s.version = "1.0.8"
s.author = "Giles Bowkett"
s.email = "gilesb@gmail.com"
s.homepage = "http://utilitybelt.rubyforge.org"

0 comments on commit 69b3aa3

Please sign in to comment.