Hi all,

I'm writing a program that I hope will function as way to track what
books I own, what books I want, and what books I have lent out and to
whom. My 'library_client.rb' file was working as expected as far as the
'while true' loop is concerned, until I added:

library = Library.new(:lib_data => ARGV[0])

Now, when I run the following command in terminal:

ruby library_client.rb lib_data

I get 11 iterations of my 'nav_options' hash and the program crashes
with a

`<main>': undefined method `chomp' for nil:NilClass (NoMethodError)

I really don't understand why adding

library = Library.new(:lib_data => ARGV[0])

would cause my program to repeat and crash. I've included all my source
code. Thoughts?

Attachments:
http://www.ruby-forum.com/attachment/9045/library.rb
http://www.ruby-forum.com/attachment/9046/library_client.rb
http://www.ruby-forum.com/attachment/9047/lib_data


-- 
Posted via http://www.ruby-forum.com/.