files for ex15

This commit is contained in:
Dan Buch 2012-02-25 23:45:19 -05:00
parent 675664b042
commit 54d0f0ca26
2 changed files with 18 additions and 0 deletions

15
ex15.rb Normal file
View File

@ -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()

3
ex15_sample.txt Normal file
View File

@ -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.