Module: UI
- Defined in:
- lib/uiux.rb
Overview
Renamed UIUX module to just UI for simplicity of calling it
Class Method Summary collapse
-
.error(message) ⇒ Object
Rename to fail one in the gem.
- .execute(command) ⇒ Object
- .heading(message) ⇒ Object
- .message(message) ⇒ Object
- .start(message, &block) ⇒ Object
- .time ⇒ Object
Class Method Details
.error(message) ⇒ Object
Rename to fail one in the gem
24 25 26 |
# File 'lib/uiux.rb', line 24 def self.error() # Rename to fail one in the gem fail "ERROR: #{message}".color(:red) end |
.execute(command) ⇒ Object
28 29 30 31 32 |
# File 'lib/uiux.rb', line 28 def self.execute(command) puts "#{'==>'.color(:blue)} #{command.bright}" puts result = `#{command}` result end |
.heading(message) ⇒ Object
16 17 18 |
# File 'lib/uiux.rb', line 16 def self.heading() puts "\n#{message}".color(:green) end |
.message(message) ⇒ Object
20 21 22 |
# File 'lib/uiux.rb', line 20 def self.() puts "#{message}".color(:white) end |
.start(message, &block) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/uiux.rb', line 7 def self.start(, &block) start_heading yield block finished rescue Exception => error puts heading_with_columns("\nFailed", '↓', time).color(:red) raise error end |
.time ⇒ Object
34 35 36 |
# File 'lib/uiux.rb', line 34 def self.time "🕑 #{Time.now.utc} 🕑 ".color(:white) end |