Module: TtyIntegration
- Included in:
- Config, Git, GitLab, GitLab::Issue, GitLab::MergeRequest, Menu, SFlow::SFlow
- Defined in:
- lib/tty_integration.rb
Instance Method Summary collapse
- #bar(message = 'Realizando validações ') ⇒ Object
- #cmd ⇒ Object
- #error(message) ⇒ Object
- #green ⇒ Object
- #pastel ⇒ Object
- #prompt ⇒ Object
- #red ⇒ Object
- #success(message) ⇒ Object
- #table ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#bar(message = 'Realizando validações ') ⇒ Object
23 24 25 |
# File 'lib/tty_integration.rb', line 23 def ( = 'Realizando validações ') TTY::ProgressBar.new("#{}[:bar]", incomplete: red, complete: green, total: 10) end |
#cmd ⇒ Object
19 20 21 |
# File 'lib/tty_integration.rb', line 19 def cmd TTY::Command.new(printer: :null) end |
#error(message) ⇒ Object
35 36 37 |
# File 'lib/tty_integration.rb', line 35 def error() print TTY::Box.error(, border: :light) end |
#green ⇒ Object
39 40 41 |
# File 'lib/tty_integration.rb', line 39 def green pastel.on_green(' ') end |
#pastel ⇒ Object
15 16 17 |
# File 'lib/tty_integration.rb', line 15 def pastel Pastel.new end |
#prompt ⇒ Object
11 12 13 |
# File 'lib/tty_integration.rb', line 11 def prompt TTY::Prompt.new(track_history: true, interrupt: :exit) end |
#red ⇒ Object
43 44 45 |
# File 'lib/tty_integration.rb', line 43 def red pastel.on_red(' ') end |
#success(message) ⇒ Object
31 32 33 |
# File 'lib/tty_integration.rb', line 31 def success() print TTY::Box.success(, border: :light) end |
#table ⇒ Object
27 28 29 |
# File 'lib/tty_integration.rb', line 27 def table TTY::Table end |
#yellow ⇒ Object
47 48 49 |
# File 'lib/tty_integration.rb', line 47 def yellow pastel.on_yellow(' ') end |