Class: Kdeploy::ConsoleOutput
Overview
Console output implementation
Instance Attribute Summary collapse
-
#pastel ⇒ Object
readonly
Returns the value of attribute pastel.
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize ⇒ ConsoleOutput
constructor
A new instance of ConsoleOutput.
- #write(message) ⇒ Object
- #write_error(message) ⇒ Object
- #write_line(message) ⇒ Object
Constructor Details
#initialize ⇒ ConsoleOutput
Returns a new instance of ConsoleOutput.
23 24 25 26 |
# File 'lib/kdeploy/output.rb', line 23 def initialize super @pastel = Pastel.new end |
Instance Attribute Details
#pastel ⇒ Object (readonly)
Returns the value of attribute pastel.
47 48 49 |
# File 'lib/kdeploy/output.rb', line 47 def pastel @pastel end |
Instance Method Details
#flush ⇒ Object
43 44 45 |
# File 'lib/kdeploy/output.rb', line 43 def flush $stdout.flush end |
#write(message) ⇒ Object
28 29 30 31 |
# File 'lib/kdeploy/output.rb', line 28 def write() print() $stdout.flush # Ensure immediate output end |
#write_error(message) ⇒ Object
38 39 40 41 |
# File 'lib/kdeploy/output.rb', line 38 def write_error() puts(@pastel.red()) $stdout.flush # Ensure immediate output end |
#write_line(message) ⇒ Object
33 34 35 36 |
# File 'lib/kdeploy/output.rb', line 33 def write_line() puts() $stdout.flush # Ensure immediate output end |