Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added highline support

  • Loading branch information...
commit f2d3f54b1006cf02e0856d15876021e9e0a9754f 1 parent 17e9b8b
Paul Betts authored
Showing with 7 additions and 6 deletions.
  1. +1 −1  lib/library.rb
  2. +6 −5 lib/main.rb
2  lib/library.rb
View
@@ -96,7 +96,7 @@ def load(files, progress_rate = 0.05)
@tag_info.delete current
end
- #save_cache
+ save_cache
log INFO, "Loaded #{@tag_info.size} files"
log DEBUG, "Exiting load"
11 lib/main.rb
View
@@ -27,6 +27,7 @@
require 'gettext'
require 'optparse'
require 'optparse/time'
+require 'highline'
# Estelle
require 'library'
@@ -156,6 +157,8 @@ def run
exit
end
+ io = HighLine.new
+
# Figure out a list of files to load
file_list = []
if results.has_key? :dir
@@ -181,16 +184,14 @@ def run
end
library.find_soundtracks do |curname|
- print _("'%s' may be a soundtrack or compilation. Is it? (Y/n) ") % curname
- (STDIN.gets =~ /^[Nn]/ ? false : true)
+ io.agree _("'%s' may be a soundtrack or compilation. Is it? (Y/n) ") % curname
end
list = library.create_action_list(results[:target],
results[:musicformat],
results[:sndtrkformat]) do |tag, invalid, *defparm|
- puts _("The tag '%s' has invalid characters; '%s' are not allowed") % [tag, invalid]
- puts _("Please type a replacement or hit enter to replace with\n%s\n" % defparm)
- STDIN.gets
+ io.say _("The tag '%s' has invalid characters; '%s' are not allowed") % [tag, invalid]
+ io.ask _("Please type a replacement or hit enter to replace with\n%s\n" % defparm)
end
# Execute the list
Please sign in to comment.
Something went wrong with that request. Please try again.