Class: RevealCK::Commands::ServeUI
- Inherits:
-
Object
- Object
- RevealCK::Commands::ServeUI
- Defined in:
- lib/reveal-ck/commands/serve_ui.rb
Overview
This object represents controls the “User Interface” of the serve command.
Constant Summary collapse
- PREFIXES =
{ default: '[ reveal-ck ]', problem: '[ problem ]', rebuild: '[ rebuild ]', reload: '[ reload ]' }
Instance Method Summary collapse
- #blank(type = nil) ⇒ Object
- #message(s, type = nil) ⇒ Object
- #prefix_for(type = nil) ⇒ Object
- #problem(general_problem, specific_error) ⇒ Object
- #separator ⇒ Object
Instance Method Details
#blank(type = nil) ⇒ Object
30 31 32 33 |
# File 'lib/reveal-ck/commands/serve_ui.rb', line 30 def blank(type = nil) prefix = PREFIXES[type] || '' puts "#{prefix}" end |
#message(s, type = nil) ⇒ Object
21 22 23 24 |
# File 'lib/reveal-ck/commands/serve_ui.rb', line 21 def (s, type = nil) prefix = prefix_for(type) puts "#{prefix} #{s}" end |
#prefix_for(type = nil) ⇒ Object
26 27 28 |
# File 'lib/reveal-ck/commands/serve_ui.rb', line 26 def prefix_for(type = nil) PREFIXES[type] || PREFIXES[:default] end |
#problem(general_problem, specific_error) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/reveal-ck/commands/serve_ui.rb', line 13 def problem(general_problem, specific_error) blank :problem general_problem, :problem blank :problem specific_error, :problem blank :problem end |
#separator ⇒ Object
35 36 37 |
# File 'lib/reveal-ck/commands/serve_ui.rb', line 35 def separator puts '------------------------------------------------------------' end |