Sha256: e6f3f0a25ed0450360d7d62e92675bb3664e525401ddbf51308b087687eac5ae
Contents?: true
Size: 1.11 KB
Versions: 14
Compression:
Stored size: 1.11 KB
Contents
module AbsoluteRenamer class InteractivePlugin < AbsoluteRenamer::IPlugin def before_batch_renaming if conf[:options][:interactive] == :once conf[:files].each do |file| file.display_change end print "Do you want to rename this files ? [y/N] " begin resp = STDIN.readline.chomp.downcase rescue Exception => e puts "\nExiting renamer" exit(0) end return resp == "y" end true end def before_file_renaming(params) if conf[:options][:interactive] == :always params[:file].display_change print "Do you want to rename this file ? [y/N] " begin resp = STDIN.readline.chomp.downcase rescue Exception => e puts "\nExiting renamer" exit(0) end return resp == "y" end true end end end
Version data entries
14 entries across 14 versions & 2 rubygems