Project 2: getting a feel for ruby

Due: Oct 1 by 11:59pm


To really get a comparitive feel for these two languages, I want you to implement the same project you just did in python, but this time do it in Ruby. This will give you an idea about how the two languages handle simple text processing: something that both languages do pretty well.


Write a ruby program that will take its first command line argument as a file name. Open that file and produce the following output from the file. Each item should be formatted nicely, labeled (so a casual reader knows which number is the number of lines, the number of words and so on.) and on its own line in the output. The output should contain all of the following:

Do this assignment as an object oriented program. Make sure that all of the bulleted functionality requirements from above are implemented in an object.

If your program in ruby is longer than about a page, you are probably making this assignment more complicated than it needs to be. (Hint, it really helps to read your book on this one. I already decided what the first assignments should be before I read the ruby book)


Submit using the online submission program we used in class for project 1