Skip to content

Commit

Permalink
remove debug prints again - ps i hate git
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckremes committed Jan 23, 2015
1 parent f96be94 commit 6330f2c
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions kernel/common/io.rb
Expand Up @@ -951,25 +951,20 @@ def initialize(io, separator, limit)

def each(&block)
if @separator
STDERR.puts "has separator"
if @separator.empty?
@separator = "\n\n"
@skip = 10
end

if @limit
STDERR.puts "read sep to limit"
read_to_separator_with_limit(&block)
else
STDERR.puts "read to sep"
read_to_separator(&block)
end
else
if @limit
STDERR.puts "read to limit"
read_to_limit(&block)
else
STDERR.puts "read all"
read_all(&block)
end
end
Expand Down Expand Up @@ -1126,7 +1121,6 @@ def read_to_separator_with_limit
consumed_bytes += bytes_read
@io.pos = starting_position + consumed_bytes

@io.pos = starting_position + consumed_chars + 1
yield str

str = ""
Expand All @@ -1140,8 +1134,6 @@ def read_to_separator_with_limit
end
end

@io.pos = starting_position + consumed_chars + 1

unless str.empty?
str = IO.read_encode(@io, str)
str.taint
Expand Down Expand Up @@ -1481,7 +1473,6 @@ def getc
end

def gets(sep_or_limit=$/, limit=nil)
STDERR.puts "each, [#{sep_or_limit.inspect}], [#{limit.inspect}]"
each sep_or_limit, limit do |line|
$_ = line if line
return line
Expand Down Expand Up @@ -2018,53 +2009,38 @@ def seek(amount, whence=SEEK_SET)
end

def set_encoding(external, internal=nil, options=undefined)
# STDERR.puts "SE1 ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
case external
when Encoding
@external = external
# STDERR.puts "SE2 ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
when String
@external = nil
# STDERR.puts "SE3 ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
when nil
if @mode == RDONLY || @external
@external = nil
else
@external = Encoding.default_external
end
# STDERR.puts "SE4 ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
else
@external = nil
external = StringValue(external)
# STDERR.puts "SE5 ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
end

if @external.nil? and not external.nil?
# STDERR.puts "A ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
# STDERR.puts "B [#{external.index(':').inspect}]"
if index = external.index(":")
internal = external[index+1..-1]
# STDERR.puts "C ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
external = external[0, index]
# STDERR.puts "D ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
end

if external[3] == ?|
# STDERR.puts "E ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
if encoding = strip_bom
external = encoding
# STDERR.puts "F ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
else
external = external[4..-1]
# STDERR.puts "G ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
end
end

# STDERR.puts "H ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
@external = Encoding.find external
# STDERR.puts "I ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"
end
# STDERR.puts "SE6 ext [#{external}], int [#{internal}], options #{options.inspect}, @ext [#{@external}], @int [#{@internal}]"

unless undefined.equal? options
# TODO: set the encoding options on the IO instance
Expand Down

0 comments on commit 6330f2c

Please sign in to comment.