From 2fa9eeb7023962772ca1e3ad9b26bdc13a6c185c Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 5 Apr 2004 15:55:09 +0000 Subject: * error.c (Init_Exception): remove Exception#to_str. [Ruby2] * eval.c (error_print): should no call "to_str" anymore use "message" method instead. * io.c (rb_f_open): Kernel#open() calls "to_open" if the first argument responds to it. [Ruby2] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/optparse.rb | 2 -- lib/pathname.rb | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/optparse.rb b/lib/optparse.rb index 4a979a78d..761504a82 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -1584,7 +1584,6 @@ Base class of exceptions from (()) Returns inspection string. --- OptionParser::ParseError#message --- OptionParser::ParseError#to_s ---- OptionParser::ParseError#to_str Default stringizing method to emit standard error message. =end #'#"#`# class ParseError < RuntimeError @@ -1625,7 +1624,6 @@ Base class of exceptions from (()) end alias to_s message - alias to_str message end =begin diff --git a/lib/pathname.rb b/lib/pathname.rb index a6d059961..c87a6e91c 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -229,6 +229,10 @@ class Pathname "#<#{self.class}:#{@path}>" end + def to_open(*args) # :nodoc: + Kernel::open(@path, *args) + end + # # Returns clean pathname of +self+ with consecutive slashes and useless dots # removed. The filesystem is not accessed. -- cgit