Module: Bobot::Generators::Utils::InstanceMethods

Included in:
InstallGenerator, UninstallGenerator
Defined in:
lib/generators/bobot/utils.rb

Instance Method Summary collapse

Instance Method Details

#ask_for(wording, default_value = nil, override_if_present_value = nil) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/generators/bobot/utils.rb', line 9

def ask_for(wording, default_value = nil, override_if_present_value = nil)
  if override_if_present_value.present?
    display("Using [#{override_if_present_value}] for question '#{wording}'") && override_if_present_value
  else
    ask("           ?  #{wording} Press <enter> for [#{default_value}] >", :yellow).presence || default_value
  end
end

#display(output, color = :green) ⇒ Object



5
6
7
# File 'lib/generators/bobot/utils.rb', line 5

def display(output, color = :green)
  say("           -  #{output}", color)
end