summaryrefslogtreecommitdiff
path: root/golf_prelude.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-25 07:04:30 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-25 07:04:30 (GMT)
commit4496da18a81b828fed293b1ab6645b6fac9be67d (patch)
treec5ed92a313794595561a5c32ddb619fa0dfd930a /golf_prelude.rb
parent319bcad626335292723e1b1d668c56e1fa5d8fb8 (diff)
* trunk/common.mk, goruby.c, golf_prelude.rb: for golfers.
* trunk/main.c (main): hook for embedding applications. * trunk/tool/compile_prelude.rb: can change initialize function name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'golf_prelude.rb')
-rw-r--r--golf_prelude.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/golf_prelude.rb b/golf_prelude.rb
new file mode 100644
index 0000000..347d316
--- /dev/null
+++ b/golf_prelude.rb
@@ -0,0 +1,7 @@
+class Object
+ def method_missing m, *a, &b
+ r = /^#{m}/
+ t = (methods + private_methods).sort.find{|e|r=~e}
+ t ? __send__(t, *a, &b) : super
+ end
+end