Module: Iev::Cli::Ui::Helper
- Defined in:
- lib/iev/cli/ui.rb
Class Method Summary collapse
Class Method Details
.clear_progress ⇒ Object
49 50 51 |
# File 'lib/iev/cli/ui.rb', line 49 def clear_progress $IEV_PROGRESS ? "\r#{' ' * 40}\r" : "" end |
.cli_out(level, *args) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/iev/cli/ui.rb', line 53 def cli_out(level, *args) topic = args[0].is_a?(Symbol) ? args.shift : nil = args.map(&:to_s).join(" ").chomp ui_tag = Thread.current[:iev_ui_tag] return unless should_out?(level, topic) print [ clear_progress, ui_tag, ui_tag && ": ", , "\n", ].join end |
.should_out?(level, topic) ⇒ Boolean
69 70 71 |
# File 'lib/iev/cli/ui.rb', line 69 def should_out?(level, topic) topic.nil? || level == :warn || ($IEV_DEBUG && $IEV_DEBUG[topic]) end |