class Recode::Handler::Prompt
Public Instance Methods
edit(file:, before:, after:)
click to toggle source
Calls superclass method
Recode::Handler::Output#edit
# File lib/recode/handler/prompt.rb, line 11 def edit(file:, before:, after:) super save_file file, after if apply? end
rename(source:, target:)
click to toggle source
Calls superclass method
Recode::Handler::Output#rename
# File lib/recode/handler/prompt.rb, line 6 def rename(source:, target:) super rename_file source, target if apply? end
Private Instance Methods
apply?()
click to toggle source
# File lib/recode/handler/prompt.rb, line 18 def apply? say "\nApply? !undgrn!Y!txtrst!es, !undgrn!n!txtrst!o, !undgrn!q!txtrst!uit : " answer = $stdin.getch.downcase if answer == 'q' or answer == "\u0003" say "!txtblu!Quit" raise Recode::Abort elsif answer == 'n' say "!txtred!No" false else say "!txtgrn!Yes" true end end