Skip to content

Commit

Permalink
Fix #15
Browse files Browse the repository at this point in the history
The first and last lines are just for backward compativility.
If those lines are deleted, a white output-area do not appear when Ostream#puts is called with no arguments.
  • Loading branch information
domitry committed Apr 26, 2015
1 parent ec9c301 commit 4e37c78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/iruby/ostream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ def write(s)
alias_method :<<, :write
alias_method :print, :write

def puts(s = nil)
write "#{s}\n"
def puts(*lines)
lines = [nil] if lines.length == 0
lines.each { |s| write("#{s}\n")}
nil
end

def writelines(lines)
Expand Down

0 comments on commit 4e37c78

Please sign in to comment.