added blocks example and gitignore

This commit is contained in:
Dan Buch 2009-06-16 22:33:38 -04:00
parent 6cab189a73
commit decd4de744
2 changed files with 9 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.log

8
blocks.rb Normal file
View File

@ -0,0 +1,8 @@
# read file and write to archive
File.open("archive.log", "a") do |saved|
File.foreach("mylogfile.log") do |sending|
puts("data = #{sending}")
# Make sure we keep a backup
saved.puts(sending) # removed superfluous string interpolation
end
end