Class: Bamboo::Client::Remote::BuildResult
- Inherits:
-
Object
- Object
- Bamboo::Client::Remote::BuildResult
- Defined in:
- lib/bamboo-client/remote.rb
Defined Under Namespace
Classes: Commit
Instance Method Summary collapse
- #commits ⇒ Object
- #duration ⇒ Object
- #duration_description ⇒ Object
- #end_time ⇒ Object
- #failed_test_count ⇒ Object
-
#initialize(doc) ⇒ BuildResult
constructor
A new instance of BuildResult.
- #key ⇒ Object
- #name ⇒ Object
- #number ⇒ Object
- #project_name ⇒ Object
- #reason ⇒ Object
- #relative_date ⇒ Object
- #start_time ⇒ Object
- #state ⇒ Object
- #successful? ⇒ Boolean
- #successful_test_count ⇒ Object
- #test_summary ⇒ Object
Constructor Details
#initialize(doc) ⇒ BuildResult
Returns a new instance of BuildResult.
129 130 131 |
# File 'lib/bamboo-client/remote.rb', line 129 def initialize(doc) @doc = doc end |
Instance Method Details
#commits ⇒ Object
200 201 202 |
# File 'lib/bamboo-client/remote.rb', line 200 def commits @doc.css('commits commit').map { |e| Commit.new(e) } end |
#duration ⇒ Object
180 181 182 |
# File 'lib/bamboo-client/remote.rb', line 180 def duration @doc.css("buildDurationInSeconds").text.to_i end |
#duration_description ⇒ Object
184 185 186 |
# File 'lib/bamboo-client/remote.rb', line 184 def duration_description @doc.css("buildDurationDescription").text end |
#end_time ⇒ Object
174 175 176 177 178 |
# File 'lib/bamboo-client/remote.rb', line 174 def end_time Time.parse @doc.css("buildCompletedDate").text rescue ArgumentError nil end |
#failed_test_count ⇒ Object
160 161 162 |
# File 'lib/bamboo-client/remote.rb', line 160 def failed_test_count @doc.css("failedTestCount").text.to_i end |
#key ⇒ Object
133 134 135 |
# File 'lib/bamboo-client/remote.rb', line 133 def key @doc.css("buildKey").text end |
#name ⇒ Object
152 153 154 |
# File 'lib/bamboo-client/remote.rb', line 152 def name @doc.css("buildName").text end |
#number ⇒ Object
156 157 158 |
# File 'lib/bamboo-client/remote.rb', line 156 def number @doc.css("buildNumber").text.to_i end |
#project_name ⇒ Object
148 149 150 |
# File 'lib/bamboo-client/remote.rb', line 148 def project_name @doc.css("projectName").text end |
#reason ⇒ Object
196 197 198 |
# File 'lib/bamboo-client/remote.rb', line 196 def reason @doc.css("buildReason").text end |
#relative_date ⇒ Object
188 189 190 |
# File 'lib/bamboo-client/remote.rb', line 188 def relative_date @doc.css("buildRelativeBuildDate").text end |
#start_time ⇒ Object
168 169 170 171 172 |
# File 'lib/bamboo-client/remote.rb', line 168 def start_time Time.parse @doc.css("buildTime").text rescue ArgumentError nil end |
#state ⇒ Object
137 138 139 140 141 142 |
# File 'lib/bamboo-client/remote.rb', line 137 def state text = @doc.css("buildState").text return 'unknown' if text.strip.empty? text.downcase.gsub(/ /, '_').to_sym end |
#successful? ⇒ Boolean
144 145 146 |
# File 'lib/bamboo-client/remote.rb', line 144 def successful? state == :successful end |
#successful_test_count ⇒ Object
164 165 166 |
# File 'lib/bamboo-client/remote.rb', line 164 def successful_test_count @doc.css("successfulTestCount").text.to_i end |
#test_summary ⇒ Object
192 193 194 |
# File 'lib/bamboo-client/remote.rb', line 192 def test_summary @doc.css("buildTestSummary").text end |