RosettaCodeData/Task/Take-notes-on-the-command-line/Ruby/take-notes-on-the-command-line.rb

7 lines
173 B
Ruby
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
notes = 'NOTES.TXT'
if ARGV.empty?
File.copy_stream(notes, $stdout) rescue nil
else
File.open(notes, 'a') {|file| file.puts "%s\n\t%s" % [Time.now, ARGV.join(' ')]}
end