Module: Roda::Project::Helpers::Input
- Included in:
- CLI
- Defined in:
- lib/roda/project/helpers/input.rb
Instance Method Summary collapse
Instance Method Details
#read_line(prompt, default) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/roda/project/helpers/input.rb', line 5 def read_line(prompt, default) val = reader.read_line(prompt).chomp return default if val == "" return false if val == "n" return true if val == "Y" || val == "y" val end |
#reader ⇒ Object
14 15 16 |
# File 'lib/roda/project/helpers/input.rb', line 14 def reader @reader ||= TTY::Reader.new end |