Class: Strobe::UI::Basic
- Inherits:
-
Object
- Object
- Strobe::UI::Basic
- Defined in:
- lib/strobe/ui.rb
Direct Known Subclasses
Instance Method Summary collapse
- #ask(message) ⇒ Object
- #confirm(msg) ⇒ Object
- #debug(msg) ⇒ Object
- #error(msg) ⇒ Object
- #highline ⇒ Object
- #info(msg) ⇒ Object
- #password(message) ⇒ Object
- #warn(msg) ⇒ Object
Instance Method Details
#ask(message) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/strobe/ui.rb', line 39 def ask() highline.ask() do |q| next unless STDIN.tty? q.readline = true end rescue EOFError '' end |
#confirm(msg) ⇒ Object
14 15 16 |
# File 'lib/strobe/ui.rb', line 14 def confirm(msg) puts msg end |
#debug(msg) ⇒ Object
6 7 8 |
# File 'lib/strobe/ui.rb', line 6 def debug(msg) puts msg end |
#error(msg) ⇒ Object
22 23 24 |
# File 'lib/strobe/ui.rb', line 22 def error(msg) puts msg end |
#highline ⇒ Object
26 27 28 |
# File 'lib/strobe/ui.rb', line 26 def highline @highline ||= HighLine.new end |
#info(msg) ⇒ Object
10 11 12 |
# File 'lib/strobe/ui.rb', line 10 def info(msg) puts msg end |
#password(message) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/strobe/ui.rb', line 30 def password() highline.ask() do |q| next unless STDIN.tty? q.echo = "*" end rescue EOFError '' end |
#warn(msg) ⇒ Object
18 19 20 |
# File 'lib/strobe/ui.rb', line 18 def warn(msg) puts msg end |