Skip to content

Instantly share code, notes, and snippets.

@Nursultan91
Created February 28, 2018 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nursultan91/ccddf0ed65442340d0d18a15a46ee98a to your computer and use it in GitHub Desktop.
Save Nursultan91/ccddf0ed65442340d0d18a15a46ee98a to your computer and use it in GitHub Desktop.
filename = ARGV.first || 'movies.txt'
abort("Файл не найден") unless File.exist?(filename)
File.readlines(filename).each do |line|
movie_hash = Hash[ [:link, :title, :year, :country, :premiere, :genre, :length, :rank, :cast].zip(line.split("|")) ]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment