diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | golf_prelude.rb | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Fri Dec 28 13:45:21 2007 Akinori MUSHA <knu@iDaemons.org> + + * golf_prelude.rb (Object.const_missing): No need to delegate to + superclass. Just raise a NameError when none matches. + Fri Dec 28 13:18:47 2007 Kouhei Sutou <kou@cozmixng.org> * lib/rss/rss.rb, test/rss/test_version.rb: 0.2.2 -> 0.2.3. 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='!') |