Class: Metanorma::Cli::UI
- Inherits:
-
Thor
- Object
- Thor
- Metanorma::Cli::UI
- Defined in:
- lib/metanorma/cli/ui.rb
Class Method Summary collapse
- .ask(message, options = {}) ⇒ Object
- .error(message) ⇒ Object
- .info(message) ⇒ Object
- .run(command) ⇒ Object
- .say(message) ⇒ Object
- .table(header, data) ⇒ Object
Class Method Details
.ask(message, options = {}) ⇒ Object
6 7 8 |
# File 'lib/metanorma/cli/ui.rb', line 6 def self.ask(, = {}) new.ask(, ) end |
.error(message) ⇒ Object
18 19 20 |
# File 'lib/metanorma/cli/ui.rb', line 18 def self.error() new.error() end |
.info(message) ⇒ Object
14 15 16 |
# File 'lib/metanorma/cli/ui.rb', line 14 def self.info() new.say(["[info]", ].join(": ")) end |
.run(command) ⇒ Object
26 27 28 29 |
# File 'lib/metanorma/cli/ui.rb', line 26 def self.run(command) require "open3" Open3.capture3(command) end |
.say(message) ⇒ Object
10 11 12 |
# File 'lib/metanorma/cli/ui.rb', line 10 def self.say() new.say() end |
.table(header, data) ⇒ Object
22 23 24 |
# File 'lib/metanorma/cli/ui.rb', line 22 def self.table(header, data) new.print_table(data.unshift(header)) end |