Class: Kicker::LogStatusHelper
- Inherits:
-
Object
- Object
- Kicker::LogStatusHelper
- Defined in:
- lib/kicker/log_status_helper.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #after? ⇒ Boolean
- #before? ⇒ Boolean
- #call(logger_type) ⇒ Object
- #growl? ⇒ Boolean
-
#initialize(proc, command) ⇒ LogStatusHelper
constructor
A new instance of LogStatusHelper.
- #result(output, success, exit_code) ⇒ Object
- #stdout? ⇒ Boolean
- #success? ⇒ Boolean
Constructor Details
#initialize(proc, command) ⇒ LogStatusHelper
Returns a new instance of LogStatusHelper.
5 6 7 |
# File 'lib/kicker/log_status_helper.rb', line 5 def initialize(proc, command) @proc, @command, @output, @success = proc, command end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
3 4 5 |
# File 'lib/kicker/log_status_helper.rb', line 3 def command @command end |
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
3 4 5 |
# File 'lib/kicker/log_status_helper.rb', line 3 def exit_code @exit_code end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
3 4 5 |
# File 'lib/kicker/log_status_helper.rb', line 3 def output @output end |
Instance Method Details
#after? ⇒ Boolean
30 31 32 |
# File 'lib/kicker/log_status_helper.rb', line 30 def after? !before? end |
#before? ⇒ Boolean
26 27 28 |
# File 'lib/kicker/log_status_helper.rb', line 26 def before? @output.nil? end |
#call(logger_type) ⇒ Object
13 14 15 16 |
# File 'lib/kicker/log_status_helper.rb', line 13 def call(logger_type) @logger_type = logger_type @proc.call(self) if @proc end |
#growl? ⇒ Boolean
22 23 24 |
# File 'lib/kicker/log_status_helper.rb', line 22 def growl? @logger_type == :growl end |
#result(output, success, exit_code) ⇒ Object
9 10 11 |
# File 'lib/kicker/log_status_helper.rb', line 9 def result(output, success, exit_code) @output, @success, @exit_code = output, success, exit_code end |
#stdout? ⇒ Boolean
18 19 20 |
# File 'lib/kicker/log_status_helper.rb', line 18 def stdout? @logger_type == :stdout end |
#success? ⇒ Boolean
34 35 36 |
# File 'lib/kicker/log_status_helper.rb', line 34 def success? @success end |