gocd 1.2 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bebfcffbf2b289e8a7b9a9b1c5dcbd71459f77d9
|
4
|
+
data.tar.gz: eb5079534dfecfb1328b730b625b07564ce5aa55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5adad969efae52ec49a18ac60d06c70d576c3bf6884caf7eea79241ee751cd2a878e77291709584f739d607ab01636453af150367c0a5f52e1389b8750e62dd7
|
7
|
+
data.tar.gz: dd8d446f38e5c3d3f45a0f1a42a40e3682a26fbebdf587ce3de573376c007e588720e3fed8a300fa6cdd3e9c6abbe309e63a5fcde73142195fa30de182762dd5
|
data/gocd.gemspec
CHANGED
@@ -6,7 +6,7 @@ require_relative './lib/gocd/version.rb'
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = 'gocd'
|
8
8
|
s.version = GOCD::VERSION
|
9
|
-
s.date = '2017-
|
9
|
+
s.date = '2017-03-01'
|
10
10
|
s.summary = 'Get info from gocd using its apis'
|
11
11
|
s.description = s.summary
|
12
12
|
s.authors = ['Ajit Singh']
|
@@ -23,5 +23,21 @@ module GOCD
|
|
23
23
|
def green?
|
24
24
|
@pipeline['lastBuildStatus'] == 'Success'
|
25
25
|
end
|
26
|
+
|
27
|
+
def web_url
|
28
|
+
@pipeline['webUrl']
|
29
|
+
end
|
30
|
+
|
31
|
+
def last_build_time
|
32
|
+
@pipeline['lastBuildTime']
|
33
|
+
end
|
34
|
+
|
35
|
+
def last_build_label
|
36
|
+
@pipeline['lastBuildLabel']
|
37
|
+
end
|
38
|
+
|
39
|
+
def to_hash
|
40
|
+
@pipeline
|
41
|
+
end
|
26
42
|
end
|
27
43
|
end
|
data/lib/gocd/version.rb
CHANGED
@@ -4,7 +4,7 @@ RSpec.describe GOCD::Pipeline, 'pipeline' do
|
|
4
4
|
|
5
5
|
context 'when last build status is success' do
|
6
6
|
before(:each) do
|
7
|
-
@raw_pipeline = {
|
7
|
+
@raw_pipeline = {'name' => 'pipeline 1', 'activity' => 'sleeping', 'lastBuildStatus' => 'Success'}
|
8
8
|
end
|
9
9
|
|
10
10
|
it '#name should return name' do
|
@@ -30,7 +30,7 @@ RSpec.describe GOCD::Pipeline, 'pipeline' do
|
|
30
30
|
|
31
31
|
context 'when last build status is failure' do
|
32
32
|
before(:each) do
|
33
|
-
@raw_pipeline = {
|
33
|
+
@raw_pipeline = {'name' => 'pipeline 1', 'activity' => 'sleeping', 'lastBuildStatus' => 'Failure'}
|
34
34
|
end
|
35
35
|
|
36
36
|
it '#green? should return false' do
|
@@ -44,4 +44,17 @@ RSpec.describe GOCD::Pipeline, 'pipeline' do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
it 'should have other details' do
|
48
|
+
@raw_pipeline = {
|
49
|
+
'name' => 'pipeline 1', 'activity' => 'sleeping',
|
50
|
+
'lastBuildStatus' => 'Success', 'webUrl' => 'http://someurl.com',
|
51
|
+
'lastBuildLabel' => 'lable', 'lastBuildTime' => '2017-02-28'
|
52
|
+
}
|
53
|
+
|
54
|
+
pipeline = GOCD::Pipeline.new @raw_pipeline
|
55
|
+
expect(pipeline.web_url).to eq('http://someurl.com')
|
56
|
+
expect(pipeline.last_build_time).to eq('2017-02-28')
|
57
|
+
expect(pipeline.last_build_label).to eq('lable')
|
58
|
+
expect(pipeline.to_hash).to eq(@raw_pipeline)
|
59
|
+
end
|
47
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gocd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ajit Singh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|