[前][次][番号順一覧][スレッド一覧]

ruby-changes:26553

From: keiju <ko1@a...>
Date: Tue, 25 Dec 2012 22:34:44 +0900 (JST)
Subject: [ruby-changes:26553] keiju:r38604 (trunk): * lib/irb/output-method.rb: raise right exception when

keiju	2012-12-25 22:34:34 +0900 (Tue, 25 Dec 2012)

  New Revision: 38604

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38604

  Log:
    * lib/irb/output-method.rb: raise right exception when
       IRB::OutputMethod#print don't defined [Bug #6657].

  Modified files:
    trunk/ChangeLog
    trunk/lib/irb/output-method.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38603)
+++ ChangeLog	(revision 38604)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Dec 25 22:21:06 2012  Keiju Ishitsuka  <keiju@i...>
+
+	* lib/irb/output-method.rb: raise right exception when
+	  IRB::OutputMethod#print don't defined [Bug #6657].
+
 Tue Dec 25 22:06:33 2012  Koichi Sasada  <ko1@a...>
 
 	* vm_trace.c (rb_threadptr_exec_event_hooks_and_pop_frame):
Index: lib/irb/output-method.rb
===================================================================
--- lib/irb/output-method.rb	(revision 38603)
+++ lib/irb/output-method.rb	(revision 38604)
@@ -16,12 +16,14 @@ module IRB https://github.com/ruby/ruby/blob/trunk/lib/irb/output-method.rb#L16
   # IRB::Notifier. You can define your own output method to use with Irb.new,
   # or Context.new
   class OutputMethod
-    @RCS_ID='-$Id$-'
+    extend Exception2MessageMapper
+    def_exception :NotImplementedError, "Need to define `%s'"
+
 
     # Open this method to implement your own output method, raises a
     # NotImplementedError if you don't define #print in your own class.
     def print(*opts)
-      IRB.fail NotImplementedError, "print"
+      OutputMethod.Raise NotImplementedError, "print"
     end
 
     # Prints the given +opts+, with a newline delimiter.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]