go_api_client 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- go_api_client (0.0.1)
4
+ go_api_client (0.0.2)
5
5
  nokogiri
6
6
 
7
7
  GEM
@@ -21,15 +21,6 @@ module GoApiClient
21
21
  self
22
22
  end
23
23
 
24
- def self.construct
25
- doc = Nokogiri::XML(open("http://localhost:8153/go/api/pipelines/defaultPipeline/stages.xml"))
26
- feed = GoApiClient::Atom::Feed.new(doc.root).parse!
27
- pipelines = []
28
- feed.entries.collect do |entry|
29
- pipelines = Stage.new(entry, pipelines).fetch
30
- end
31
- pipelines
32
- end
33
24
  end
34
25
  end
35
26
 
@@ -78,6 +69,11 @@ module GoApiClient
78
69
  self
79
70
  end
80
71
 
72
+ def authors
73
+ authors = stages.map(&:authors).flatten
74
+ authors.map(&:name).flatten.uniq.join(" ,")
75
+ end
76
+
81
77
  def same?(link)
82
78
  @details_link == link
83
79
  end
@@ -1,3 +1,3 @@
1
1
  module GoApiClient
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -8,9 +8,11 @@ class IntegrationTest < Test::Unit::TestCase
8
8
  stub_request(:get, "http://localhost:8153/go/api/stages/1.xml").to_return(:body => file_contents("stages_1.xml"))
9
9
  stub_request(:get, "http://localhost:8153/go/api/stages/2.xml").to_return(:body => file_contents("stages_2.xml"))
10
10
  pipelines = GoApiClient.runs("localhost:8153")
11
- assert_equal 1, pipelines.count
12
11
  stages = pipelines.first.stages
12
+
13
+ assert_equal 1, pipelines.count
13
14
  assert_equal 2, stages.count
15
+ assert_equal "oogabooga <twgosaas@gmail.com>", pipelines.first.authors
14
16
  stages.each do |stage|
15
17
  assert_equal "oogabooga <twgosaas@gmail.com>", stage.authors.first.name
16
18
  assert_equal "Failed", stage.result
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.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-24 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &70232878359900 !ruby/object:Gem::Requirement
16
+ requirement: &70235413447040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70232878359900
24
+ version_requirements: *70235413447040
25
25
  description: This gem parses atom feed generated by the Go Continuous Integration
26
26
  server and provides an OO representation of the pipelines and stages.
27
27
  email: