summaryrefslogtreecommitdiff
path: root/golf_prelude.rb
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-03 12:21:32 (GMT)
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-03 12:21:32 (GMT)
commitb99c31b38f883ef5dcd74dd9f791de7f1089435e (patch)
treefe3be472080940cd7625771e8102636a13a1b0e2 /golf_prelude.rb
parent6fe24d1f1332bc79458fdac8b3c66ed2db13d390 (diff)
* golf_prelude.rb: suppress warning when goruby -v.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'golf_prelude.rb')
-rw-r--r--golf_prelude.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/golf_prelude.rb b/golf_prelude.rb
index 15c1832..2548314 100644
--- a/golf_prelude.rb
+++ b/golf_prelude.rb
@@ -78,7 +78,8 @@ class String
end
(Array.instance_methods-instance_methods-[:to_ary,:transpose,:flatten,:flatten!,:compact,:compact!,:assoc,:rassoc]).each{|meth|
- eval"def #{meth}(*args, &block)
+ eval"
+ def #{meth}(*args, &block)
a=to_a
result = a.#{meth}(*args, &block)
replace(a.join)
@@ -96,7 +97,8 @@ end
class Enumerator
alias old_to_s to_s
(Array.instance_methods-instance_methods-[:replace]+[:to_s]).each{|meth|
- eval"def #{meth}(*args, &block)
+ eval"
+ def #{meth}(*args, &block)
to_a.#{meth}(*args, &block)
end"
}