From decd4de744a4c685ae4d6d9606d9921d27096041 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Tue, 16 Jun 2009 22:33:38 -0400 Subject: [PATCH] added blocks example and gitignore --- .gitignore | 1 + blocks.rb | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 .gitignore create mode 100644 blocks.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..397b4a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.log diff --git a/blocks.rb b/blocks.rb new file mode 100644 index 0000000..ac47eb8 --- /dev/null +++ b/blocks.rb @@ -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