Changes between Version 4 and Version 5 of SummaryRuby


Ignore:
Timestamp:
Nov 15, 2014, 3:46:14 PM (10 years ago)
Author:
Thanatermesis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SummaryRuby

    v4 v5  
    605605f.pos = 8
    606606puts "position in file has moved to: " + f.pos
     607f.close # close the file when finish!
    607608
    608609# by using File.open in a block, is not needed to close the file when finish
    609 File.open("text.txt", "w") do |entry| entry.puts "Hi" end
     610File.open("text.txt", "w") do |file| file.puts "Hi" end
    610611# note that the next line is invalid, if you put a space before ( then is not an argument list what you pass to it
    611 #File.open      ("text.txt", "w") do |entry| entry.puts "Hi" end
     612#File.open      ("text.txt", "w") do |file| file.puts "Hi" end
    612613
    613614# appending