Created
November 15, 2019 14:12
-
-
Save Prigin/955586d2b078c2bc7c9a0fece4c51a75 to your computer and use it in GitHub Desktop.
mkdev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require '../movie_coll.rb' | |
check_data = [:link, :title, :year, :country, :date, | |
:genre, :duration, :rating, :director, :stars] | |
check_mas = MovieCollection.new('test.txt') | |
check_data.each do |unit| | |
File.open("test_stats_#{unit}.txt", 'w') do |file| | |
file.puts check_mas.stats(unit) | |
end | |
File.open("test_sort_by_#{unit}.txt", 'w') do |file| | |
file.puts check_mas.sort_by(unit).map{ |u| | |
"#{u.link}|#{u.title}|#{u.year}|#{u.country}|#{u.date}|#{u.genre.join(',')}|#{u.duration} min|#{u.rating}|#{u.director.join(',')}|#{u.stars.join(',')}" } | |
end | |
end | |
#File.open("test_filter_#{i}.txt", 'w') do | |
#end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment