Module: Mundane::Prompter

Extended by:
FileWorker, Prompter
Included in:
FilesToZips, Prompter, ZipsToFiles
Defined in:
lib/mundane/prompter.rb

Instance Method Summary collapse

Methods included from FileWorker

count_targeted_files, get_files_in_current_folder, make_output_directory

Instance Method Details

#construct_informative_message(prompt) ⇒ Object



16
17
18
# File 'lib/mundane/prompter.rb', line 16

def construct_informative_message(prompt)
  prompt.sub("%count_targeted_files%", count_targeted_files.to_s)
end

#prompt_user(prompt) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/mundane/prompter.rb', line 5

def prompt_user(prompt)
  puts construct_informative_message(prompt)
  proceed = STDIN.gets.strip.downcase
  
  if proceed == "y" or proceed == "yes" or proceed == ""
    true 
  else
    false
  end
end