def cityList
c_list = [
    'Boston',
    'Nashville',
    'San Francisco',
    'Houston',
    'Portland',
    'Atlanta',
    'Chicago',
    'Indianapolis',
    'Charleston'
    ]

bar = '|| '

temp_array = []

temp_array.push puts bar + c_list[0..2].join(' pets || ') + (' pets 
||'+'/n')

temp_array.push puts bar + c_list[3..5].join(' pets || ') + (' pets 
||'+'/n')

temp_array.push puts bar + c_list[6..8].join(' pets || ') + (' pets 
||'+'/n')

end



puts 'File completed. Save as..?'
save_as = gets.chomp



File::open("c:\rubyfiles\citylist-#{save_as}.txt", 'w') do |f|
  f.write cityList

end

********

This is the error it gives me...:

directory\rubyprograms\cities.rb:33:in 'initialize':
ubyfiles    tylist-city1.txt (Errno::EINVAL)
   from directory\rubyprograms\cities.rb:33:in
'open'
   from directory\rubyprograms\cities.rb:33

********


There's something wrong with the code, I know, but I'm not sure what.
-- 
Posted via http://www.ruby-forum.com/.