go_api_client 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.rbenv-gemsets +1 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +1 -1
- data/lib/go_api_client/pipeline.rb +8 -8
- data/lib/go_api_client/version.rb +1 -1
- data/test/go_api_client/pipeline_test.rb +1 -0
- metadata +4 -2
data/.rbenv-gemsets
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
go-api-client
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3-p392
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module GoApiClient
|
2
2
|
class Pipeline
|
3
|
-
attr_accessor :url, :commits, :label, :counter, :authors, :stages, :name, :http_fetcher, :identifier, :schedule_time
|
3
|
+
attr_accessor :url, :commits, :label, :counter, :authors, :stages, :name, :http_fetcher, :identifier, :schedule_time, :branch_name
|
4
4
|
|
5
5
|
include GoApiClient::Helpers::SimpleAttributesSupport
|
6
6
|
|
@@ -22,13 +22,14 @@ module GoApiClient
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def parse!
|
25
|
-
self.name
|
26
|
-
self.label
|
27
|
-
self.counter
|
28
|
-
self.url
|
29
|
-
self.identifier
|
25
|
+
self.name = @root.attributes["name"].value
|
26
|
+
self.label = @root.attributes["label"].value
|
27
|
+
self.counter = @root.attributes["counter"].value.to_i
|
28
|
+
self.url = href_from(@root.xpath("./link[@rel='self']"))
|
29
|
+
self.identifier = @root.xpath("./id").first.content
|
30
30
|
self.schedule_time = Time.parse(@root.xpath('./scheduleTime').first.content).utc
|
31
|
-
self.
|
31
|
+
self.branch_name = @root.xpath('./materials/material').first.attribute('branch').value
|
32
|
+
self.commits = @root.xpath('./materials/material[@type = "GitMaterial"]/modifications/changeset').collect do |changeset|
|
32
33
|
Commit.new(changeset).parse!
|
33
34
|
end
|
34
35
|
|
@@ -44,6 +45,5 @@ module GoApiClient
|
|
44
45
|
def href_from(xml)
|
45
46
|
xml.first.attribute('href').value unless xml.empty?
|
46
47
|
end
|
47
|
-
|
48
48
|
end
|
49
49
|
end
|
@@ -18,6 +18,7 @@ module GoApiClient
|
|
18
18
|
assert_equal ["Update README", "Fixed build"], pipeline.commits.collect(&:message)
|
19
19
|
assert_equal "urn:x-go.studios.thoughtworks.com:job-id:defaultPipeline:1", pipeline.identifier
|
20
20
|
assert_equal Time.parse('2012-02-23 11:46:15 UTC'), pipeline.schedule_time
|
21
|
+
assert_equal 'master', pipeline.branch_name
|
21
22
|
end
|
22
23
|
|
23
24
|
test "should return a list of authors from the first stage" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-06-03 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: webmock
|
@@ -105,6 +105,8 @@ extra_rdoc_files: []
|
|
105
105
|
files:
|
106
106
|
- .gitignore
|
107
107
|
- .init.sh
|
108
|
+
- .rbenv-gemsets
|
109
|
+
- .ruby-version
|
108
110
|
- .rvmrc
|
109
111
|
- .yardopts
|
110
112
|
- Gemfile
|