Class: Kicker::LogStatusHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/kicker/log_status_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commandObject (readonly)

Returns the value of attribute command.



3
4
5
# File 'lib/kicker/log_status_helper.rb', line 3

def command
  @command
end

#exit_codeObject (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

#outputObject (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

Returns:

  • (Boolean)


30
31
32
# File 'lib/kicker/log_status_helper.rb', line 30

def after?
  !before?
end

#before?Boolean

Returns:

  • (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

Returns:

  • (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

Returns:

  • (Boolean)


18
19
20
# File 'lib/kicker/log_status_helper.rb', line 18

def stdout?
  @logger_type == :stdout
end

#success?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/kicker/log_status_helper.rb', line 34

def success?
  @success
end