Module: Iev::Cli::Ui
- Included in:
- CommandHelper, DbWriter, RelatonDb, SourceParser, SupersessionParser, TermAttrsParser, TermBuilder
- Defined in:
- lib/iev/cli/ui.rb
Overview
TODO:
Make it thread-safe. Currently, calling UI methods from different threads may result with mangled output. At first glance it seems like something is wrong with carriage returns, but more research is needed.
Defined Under Namespace
Modules: Helper
Class Method Summary collapse
- .debug(*args) ⇒ Object
-
.info(message) ⇒ Object
Prints generic message.
-
.progress(message) ⇒ Object
Prints progress message which will be replaced on next call.
-
.set_ui_tag(str) ⇒ Object
Sets an UI tag which will be prepended to messages printed with #debug and #warn.
- .warn(*args) ⇒ Object
Class Method Details
.debug(*args) ⇒ Object
15 16 17 |
# File 'lib/iev/cli/ui.rb', line 15 def debug(*args) Helper.cli_out(:debug, *args) end |
.info(message) ⇒ Object
Prints generic message.
31 32 33 |
# File 'lib/iev/cli/ui.rb', line 31 def info() print "#{Helper.clear_progress}#{}\n" end |
.progress(message) ⇒ Object
Prints progress message which will be replaced on next call.
24 25 26 27 28 |
# File 'lib/iev/cli/ui.rb', line 24 def progress() return unless $IEV_PROGRESS print "#{Helper.clear_progress}#{} " end |
.set_ui_tag(str) ⇒ Object
Sets an UI tag which will be prepended to messages printed with #debug and #warn.
37 38 39 |
# File 'lib/iev/cli/ui.rb', line 37 def set_ui_tag(str) Thread.current[:iev_ui_tag] = str end |