Created
November 14, 2012 05:22
-
-
Save camillol/4070437 to your computer and use it in GitHub Desktop.
homebrew-pcc: work around Ruby 1.8.6's lack of Symbol#to_proc
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
Library/Homebrew/extend/symbol.rb | 7 +++++++ | |
Library/Homebrew/global.rb | 1 + | |
2 files changed, 8 insertions(+) | |
create mode 100644 Library/Homebrew/extend/symbol.rb | |
diff --git a/Library/Homebrew/extend/symbol.rb b/Library/Homebrew/extend/symbol.rb | |
new file mode 100644 | |
index 0000000..00ac103 | |
--- /dev/null | |
+++ b/Library/Homebrew/extend/symbol.rb | |
@@ -0,0 +1,7 @@ | |
+class Symbol | |
+ unless Symbol.method_defined?(:to_proc) | |
+ def to_proc | |
+ proc { |obj, *args| obj.send(self, *args) } | |
+ end | |
+ end | |
+end | |
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb | |
index d7071ea..2888126 100644 | |
--- a/Library/Homebrew/global.rb | |
+++ b/Library/Homebrew/global.rb | |
@@ -2,6 +2,7 @@ require 'extend/fileutils' | |
require 'extend/pathname' | |
require 'extend/ARGV' | |
require 'extend/string' | |
+require 'extend/symbol' | |
require 'utils' | |
require 'exceptions' | |
require 'set' | |
-- | |
1.7.11.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment