Class: XcodeBuild::BuildAction
- Inherits:
-
Object
- Object
- XcodeBuild::BuildAction
show all
- Defined in:
- lib/xcode_build/build_action.rb
Defined Under Namespace
Classes: Warning
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(metadata) ⇒ BuildAction
Returns a new instance of BuildAction.
10
11
12
13
14
15
16
|
# File 'lib/xcode_build/build_action.rb', line 10
def initialize(metadata)
@steps_completed = []
@metadata = metadata
@started_at = Time.now
@warnings = []
super()
end
|
Instance Attribute Details
#finished_at=(value) ⇒ Object
Sets the attribute finished_at
8
9
10
|
# File 'lib/xcode_build/build_action.rb', line 8
def finished_at=(value)
@finished_at = value
end
|
#steps_completed ⇒ Object
Returns the value of attribute steps_completed.
7
8
9
|
# File 'lib/xcode_build/build_action.rb', line 7
def steps_completed
@steps_completed
end
|
#warnings ⇒ Object
Returns the value of attribute warnings.
7
8
9
|
# File 'lib/xcode_build/build_action.rb', line 7
def warnings
@warnings
end
|
Instance Method Details
#add_step(params) ⇒ Object
32
33
34
|
# File 'lib/xcode_build/build_action.rb', line 32
def add_step(params)
@steps_completed << BuildStep.new(params)
end
|
#add_warning(params) ⇒ Object
89
90
91
|
# File 'lib/xcode_build/build_action.rb', line 89
def add_warning(params)
@warnings << Warning.new(params)
end
|
#configuration ⇒ Object
81
82
83
|
# File 'lib/xcode_build/build_action.rb', line 81
def configuration
@metadata[:configuration]
end
|
#default_configuration? ⇒ Boolean
85
86
87
|
# File 'lib/xcode_build/build_action.rb', line 85
def default_configuration?
@metadata[:default]
end
|
#duration ⇒ Object
64
65
66
67
|
# File 'lib/xcode_build/build_action.rb', line 64
def duration
return nil unless finished?
@finished_at - @started_at
end
|
#error_count ⇒ Object
60
61
62
|
# File 'lib/xcode_build/build_action.rb', line 60
def error_count
has_errors? ? (failed_steps.map { |s| s.errors.length }) : 0
end
|
#failed_steps ⇒ Object
36
37
38
|
# File 'lib/xcode_build/build_action.rb', line 36
def failed_steps
@steps_completed.select { |a| a.failed? }
end
|
#finished? ⇒ Boolean
48
49
50
|
# File 'lib/xcode_build/build_action.rb', line 48
def finished?
successful? || failed?
end
|
#has_errors? ⇒ Boolean
52
53
54
|
# File 'lib/xcode_build/build_action.rb', line 52
def has_errors?
failed_steps.any?
end
|
#has_warnings? ⇒ Boolean
56
57
58
|
# File 'lib/xcode_build/build_action.rb', line 56
def has_warnings?
warnings.any?
end
|
#label ⇒ Object
69
70
71
|
# File 'lib/xcode_build/build_action.rb', line 69
def label
@label.downcase.capitalize
end
|
#last_step ⇒ Object
44
45
46
|
# File 'lib/xcode_build/build_action.rb', line 44
def last_step
@steps_completed.last
end
|
#project_name ⇒ Object
73
74
75
|
# File 'lib/xcode_build/build_action.rb', line 73
def project_name
@metadata[:project]
end
|
#step_with_params(params) ⇒ Object
40
41
42
|
# File 'lib/xcode_build/build_action.rb', line 40
def step_with_params(params)
@steps_completed.detect { |a| a == BuildStep.new(params) }
end
|
#target ⇒ Object
77
78
79
|
# File 'lib/xcode_build/build_action.rb', line 77
def target
@metadata[:target]
end
|