From 54d0f0ca2635946b46445f08fb9e31eb0b787643 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sat, 25 Feb 2012 23:45:19 -0500 Subject: [PATCH] files for ex15 --- ex15.rb | 15 +++++++++++++++ ex15_sample.txt | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 ex15.rb create mode 100644 ex15_sample.txt diff --git a/ex15.rb b/ex15.rb new file mode 100644 index 0000000..5be6005 --- /dev/null +++ b/ex15.rb @@ -0,0 +1,15 @@ +filename = ARGV.first + +prompt = "> " +txt = File.open(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.open(file_again) + +puts txt_again.read() diff --git a/ex15_sample.txt b/ex15_sample.txt new file mode 100644 index 0000000..f4a96d5 --- /dev/null +++ b/ex15_sample.txt @@ -0,0 +1,3 @@ +This is stuff I typed into a file. +It is really cool stuff. +Lots and lots of fun to have in here.