[3722] MacRuby/branches/icu/lib/stringio.rb
Revision: 3722 http://trac.macosforge.org/projects/ruby/changeset/3722 Author: lsansonetti@apple.com Date: 2010-03-09 17:53:55 -0800 (Tue, 09 Mar 2010) Log Message: ----------- ByteString no longer exist Modified Paths: -------------- MacRuby/branches/icu/lib/stringio.rb Modified: MacRuby/branches/icu/lib/stringio.rb =================================================================== --- MacRuby/branches/icu/lib/stringio.rb 2010-03-10 01:46:19 UTC (rev 3721) +++ MacRuby/branches/icu/lib/stringio.rb 2010-03-10 01:53:55 UTC (rev 3722) @@ -52,7 +52,7 @@ # # Creates new StringIO instance from with _string_ and _mode_. # - def initialize(string = ByteString.new, mode = nil) + def initialize(string = String.new, mode = nil) @string = string.to_str @pos = 0 @lineno = 0 @@ -127,7 +127,7 @@ # # See IO#read. # - def read(length = nil, buffer = ByteString.new) + def read(length = nil, buffer = String.new) raise IOError, "not opened for reading" unless @readable raise TypeError unless buffer.respond_to?(:to_str) buffer = buffer.to_str @@ -152,7 +152,7 @@ # # Similar to #read, but raises +EOFError+ at end of string instead of # returning +nil+, as well as IO#sysread does. - def sysread(length = nil, buffer = ByteString.new) + def sysread(length = nil, buffer = String.new) val = read(length, buffer) ( buffer.clear && raise(IO::EOFError, "end of file reached")) if val == nil val
participants (1)
-
source_changes@macosforge.org