Created
September 25, 2019 01:02
-
-
Save Prigin/91bdaf3ff374107ddf2b083c5e23f64d 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
doc = ARGV[0] | |
def Output (file) | |
print "[search]> " | |
@search = gets.chomp # how to avoid THIS?! | |
file.readlines.each do |line| | |
line = line.split("|") | |
if line[1].include?(@search) # how to avoid THIS?! | |
print line[1] + " | " | |
puts "*" * (line[7].to_f * 10 - 80) | |
end | |
end | |
end | |
if doc == nil | |
File.open("movies.txt") {|file| Output(file)} | |
elsif File.exist?(doc) | |
File.open(doc) {|file| Output(file)} | |
else | |
puts "no such file" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment