Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9dd628a31d4d
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a4bf31efebff
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Oct 3, 2015

  1. Copy the full SHA
    902fa12 View commit details
  2. Copy the full SHA
    a4bf31e View commit details
Showing with 3 additions and 3 deletions.
  1. +3 −3 kernel/common/io.rb
6 changes: 3 additions & 3 deletions kernel/common/io.rb
Original file line number Diff line number Diff line change
@@ -1059,8 +1059,6 @@ def self.foreach(name, separator=undefined, limit=undefined, options=undefined)
options = Rubinius::Type.coerce_to options, Hash, :to_hash
end

saved_line = $_

if name[0] == ?|
io = IO.popen(name[1..-1], "r")
return nil unless io
@@ -1074,7 +1072,7 @@ def self.foreach(name, separator=undefined, limit=undefined, options=undefined)
yield line
end
ensure
$_ = saved_line
$_ = nil
io.close
end

@@ -1083,8 +1081,10 @@ def self.foreach(name, separator=undefined, limit=undefined, options=undefined)

def self.readlines(name, separator=undefined, limit=undefined, options=undefined)
lines = []
saved_line = $_
foreach(name, separator, limit, options) { |l| lines << l }

$_ = saved_line
lines
end