Created
December 28, 2010 10:31
-
-
Save kschiess/757123 to your computer and use it in GitHub Desktop.
a patch for the map gem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 76d3b0e6e95097915e210faccc226562fe2723de Mon Sep 17 00:00:00 2001 | |
From: Kaspar Schiess <kaspar.schiess@absurd.li> | |
Date: Tue, 28 Dec 2010 11:24:04 +0100 | |
Subject: [PATCH 1/2] . ignores argument and is thus a proc | |
--- | |
lib/map.rb | 2 +- | |
1 files changed, 1 insertions(+), 1 deletions(-) | |
diff --git a/lib/map.rb b/lib/map.rb | |
index 4b62581..6903c9a 100644 | |
--- a/lib/map.rb | |
+++ b/lib/map.rb | |
@@ -127,7 +127,7 @@ class Map < Hash | |
alias_method '[]', 'new' | |
end | |
- Dynamic = lambda do | |
+ Dynamic = proc do | |
conversion_methods.reverse_each do |method| | |
add_conversion_method!(method) | |
end | |
-- | |
1.7.3.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From cd85c76fb517e5b62e4819a4bbac5ac53c573c62 Mon Sep 17 00:00:00 2001 | |
From: Kaspar Schiess <kaspar.schiess@absurd.li> | |
Date: Tue, 28 Dec 2010 11:30:04 +0100 | |
Subject: [PATCH 2/2] . typo | |
--- | |
lib/map.rb | 2 +- | |
1 files changed, 1 insertions(+), 1 deletions(-) | |
diff --git a/lib/map.rb b/lib/map.rb | |
index 6903c9a..3bd481e 100644 | |
--- a/lib/map.rb | |
+++ b/lib/map.rb | |
@@ -65,7 +65,7 @@ class Map < Hash | |
def add_conversion_method!(method) | |
method = method.to_s.strip | |
- raise ArguementError if method.empty? | |
+ raise ArgumentError if method.empty? | |
module_eval(<<-__, __FILE__, __LINE__) | |
unless public_method_defined?(#{ method.inspect }) | |
def #{ method } | |
-- | |
1.7.3.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment