ruby-changes:3261
From: ko1@a...
Date: 28 Dec 2007 13:47:13 +0900
Subject: [ruby-changes:3261] knu - Ruby:r14754 (trunk): * golf_prelude.rb (Object.const_missing): No need to delegate to
knu 2007-12-28 13:46:56 +0900 (Fri, 28 Dec 2007)
New Revision: 14754
Modified files:
trunk/ChangeLog
trunk/golf_prelude.rb
Log:
* golf_prelude.rb (Object.const_missing): No need to delegate to
superclass. Just raise a NameError when none matches.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/golf_prelude.rb?r1=14754&r2=14753
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14754&r2=14753
Index: ChangeLog
===================================================================
--- ChangeLog (revision 14753)
+++ ChangeLog (revision 14754)
@@ -1,3 +1,8 @@
+Fri Dec 28 13:45:21 2007 Akinori MUSHA <knu@i...>
+
+ * 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@c...>
* lib/rss/rss.rb, test/rss/test_version.rb: 0.2.2 -> 0.2.3.
Index: golf_prelude.rb
===================================================================
--- golf_prelude.rb (revision 14753)
+++ golf_prelude.rb (revision 14754)
@@ -9,8 +9,8 @@
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='!')
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml