diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-28 04:46:56 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-28 04:46:56 +0000 |
commit | 7ad2d4cc9a4ef56aadc3823f938e7f77ced55765 (patch) | |
tree | 152d75f846ffb4d91f789f75fa5f0f38bbb6e978 /golf_prelude.rb | |
parent | 9343a2deb3c72047d0aee1449d185d066ca89b44 (diff) | |
download | bundler-7ad2d4cc9a4ef56aadc3823f938e7f77ced55765.tar.gz |
* golf_prelude.rb (Object.const_missing): No need to delegate to
superclass. Just raise a NameError when none matches.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'golf_prelude.rb')
-rw-r--r-- | golf_prelude.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/golf_prelude.rb b/golf_prelude.rb index 03c0c6cceb..69cbfb1297 100644 --- a/golf_prelude.rb +++ b/golf_prelude.rb @@ -9,8 +9,8 @@ class Object def self.const_missing c r = /^#{c}/ - t = constants.sort.find{|e|r=~e} - t ? const_get(t) : superclass.const_get(c) + t = constants.sort.find{|e|r=~e} and return const_get(t) + raise NameError, "uninitialized constant #{c}", caller(1) end def h(a='H', b='w', c='!') |