Changes between Version 5 and Version 6 of SummaryRuby


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

--

Legend:

Unmodified
Added
Removed
Modified
  • SummaryRuby

    v5 v6  
    609609# by using File.open in a block, is not needed to close the file when finish
    610610File.open("text.txt", "w") do |file| file.puts "Hi" end
    611 # note that the next line is invalid, if you put a space before ( then is not an argument list what you pass to it
    612 #File.open      ("text.txt", "w") do |file| file.puts "Hi" end
    613611
    614612# appending
     
    621619puts f.hour # since the object returned (f) is a Time object, we can treat him as it
    622620
     621
     622#
     623# Typos / Pitfails
     624#
     625
     626# if you put a space before ( it is then not interpreted as arguments, ( needs to be always joint with the call
     627File.open ("text.txt", "w")
     628
     629# if you put more than one space like here it is then interpreted as a(+b)
     630a  + b
    623631
    624632