From 4900d8fb2783c44948269478949203dfa8c2e6b1 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sat, 25 Feb 2012 23:51:41 -0500 Subject: [PATCH] lots of extra credit this time, so making sure I'm familiar with it --- ex15-ec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ex15-ec.rb diff --git a/ex15-ec.rb b/ex15-ec.rb new file mode 100644 index 0000000..a111ec9 --- /dev/null +++ b/ex15-ec.rb @@ -0,0 +1,18 @@ +filename = ARGV.first + +prompt = "> " +txt = File.new(filename) + +puts "Here's your file: #{filename}" +puts txt.read + +puts "I'll also ask you to type it again:" +print prompt +file_again = STDIN.gets.chomp + +txt_again = File.new(file_again) + +puts txt_again.read + +txt.close +txt_again.close