Module: PrivatePerson::Generators::Utils
- Included in:
- InstallGenerator
- Defined in:
- lib/generators/private_person/utils.rb
Instance Method Summary collapse
- #ask_for(wording, default_value = nil, override_if_present_value = nil) ⇒ Object
- #output(output, color = :green) ⇒ Object
Instance Method Details
#ask_for(wording, default_value = nil, override_if_present_value = nil) ⇒ Object
8 9 10 11 12 |
# File 'lib/generators/private_person/utils.rb', line 8 def ask_for(wording, default_value = nil, override_if_present_value = nil) override_if_present_value.present? ? display("Using [#{override_if_present_value}] for question '#{wording}'") && override_if_present_value : ask(" ? #{wording} Press <enter> for [#{default_value}] >", :yellow).presence || default_value end |
#output(output, color = :green) ⇒ Object
4 5 6 |
# File 'lib/generators/private_person/utils.rb', line 4 def output(output, color = :green) say(" - #{output}", color) end |