simple_jenkins 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/simple_jenkins/adapter.rb +1 -0
- data/lib/simple_jenkins/job.rb +12 -15
- data/lib/simple_jenkins/version.rb +1 -1
- data/simple_jenkins.gemspec +1 -0
- data/spec/lib/job_spec.rb +62 -0
- metadata +17 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d389f279b19d21d66aca175323154cee9ee3a0f1
|
4
|
+
data.tar.gz: d6c8eb75462aa9e517ef19c1e1e263fa522dd229
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cba1f3d6bf3c2d396c1332493ee09cc5878ffc51af990e8e9bf938b5ac6b324838f6d8b273b5f788186a1fc60ca31fc760d52cb498462af64052dcc0e0775db3
|
7
|
+
data.tar.gz: 0931608e9f389dbae495be40d497dd4b87a20d4a384d144b7569fbe151080b613ad65024909ccbe3c867c7b9bb18513a18ce15fbca2b14601a18d8124613ecd7
|
data/lib/simple_jenkins/job.rb
CHANGED
@@ -31,8 +31,8 @@ module SimpleJenkins
|
|
31
31
|
result == 'FAILURE'
|
32
32
|
end
|
33
33
|
|
34
|
-
def
|
35
|
-
building
|
34
|
+
def building?
|
35
|
+
building
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
@@ -79,23 +79,20 @@ module SimpleJenkins
|
|
79
79
|
URI::encode(@url)
|
80
80
|
end
|
81
81
|
|
82
|
-
def
|
83
|
-
|
84
|
-
when /disabled/
|
85
|
-
'DISA'
|
86
|
-
when /red/
|
87
|
-
'FAIL'
|
88
|
-
else
|
89
|
-
'SUCC'
|
90
|
-
end
|
82
|
+
def building?
|
83
|
+
lastBuild.building?
|
91
84
|
end
|
92
85
|
|
93
|
-
def
|
94
|
-
|
86
|
+
def passing?
|
87
|
+
!disabled? && lastCompletedBuild.success?
|
95
88
|
end
|
96
89
|
|
97
|
-
def
|
98
|
-
lastCompletedBuild.
|
90
|
+
def failing?
|
91
|
+
!disabled? && lastCompletedBuild.failure?
|
92
|
+
end
|
93
|
+
|
94
|
+
def disabled?
|
95
|
+
color == 'disabled'
|
99
96
|
end
|
100
97
|
end
|
101
98
|
end
|
data/simple_jenkins.gemspec
CHANGED
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe SimpleJenkins::Job do
|
4
|
+
|
5
|
+
it "knows when it is passing" do
|
6
|
+
job = SimpleJenkins::Job.new(
|
7
|
+
color: "red",
|
8
|
+
lastCompletedBuild: {result: "SUCCESS"}
|
9
|
+
)
|
10
|
+
|
11
|
+
expect(job.passing?).to eq(true)
|
12
|
+
expect(job.failing?).to eq(false)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "knows when it is failing" do
|
16
|
+
job = SimpleJenkins::Job.new(
|
17
|
+
color: "red",
|
18
|
+
lastCompletedBuild: {result: "FAILURE"}
|
19
|
+
)
|
20
|
+
|
21
|
+
expect(job.passing?).to eq(false)
|
22
|
+
expect(job.failing?).to eq(true)
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
describe "disabled jobs" do
|
27
|
+
it "knows when it is disabled" do
|
28
|
+
job = SimpleJenkins::Job.new(color: "disabled")
|
29
|
+
expect(job.disabled?).to eq(true)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "isn't passing or failing when disabled" do
|
33
|
+
job = SimpleJenkins::Job.new(color: "disabled", lastCompletedBuild: {result: "FAILURE"})
|
34
|
+
expect(job.disabled?).to eq(true)
|
35
|
+
expect(job.failing?).to eq(false)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "isn't passing or failing when disabled" do
|
39
|
+
job = SimpleJenkins::Job.new(color: "disabled", lastCompletedBuild: {result: "SUCCESS"})
|
40
|
+
expect(job.disabled?).to eq(true)
|
41
|
+
expect(job.passing?).to eq(false)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "knows when it is not disabled" do
|
45
|
+
job = SimpleJenkins::Job.new(lastCompletedBuild: {result: "SUCCESS"})
|
46
|
+
expect(job.disabled?).to eq(false)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
it "knows when it is building" do
|
51
|
+
job = SimpleJenkins::Job.new(lastBuild: {building: true})
|
52
|
+
|
53
|
+
expect(job.building?).to eq(true)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "knows when it is not building" do
|
57
|
+
job = SimpleJenkins::Job.new(lastBuild: {building: false})
|
58
|
+
|
59
|
+
expect(job.building?).to eq(false)
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_jenkins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Kerr
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: json
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description:
|
98
112
|
email:
|
99
113
|
- adamk@nulogy.com
|
@@ -118,6 +132,7 @@ files:
|
|
118
132
|
- spec/fixtures/jobs_success.json
|
119
133
|
- spec/fixtures/views_success.json
|
120
134
|
- spec/lib/adapter_spec.rb
|
135
|
+
- spec/lib/job_spec.rb
|
121
136
|
- spec/spec_helper.rb
|
122
137
|
homepage: http://github.com/nulogy/simple_jenkins
|
123
138
|
licenses:
|
@@ -147,4 +162,5 @@ test_files:
|
|
147
162
|
- spec/fixtures/jobs_success.json
|
148
163
|
- spec/fixtures/views_success.json
|
149
164
|
- spec/lib/adapter_spec.rb
|
165
|
+
- spec/lib/job_spec.rb
|
150
166
|
- spec/spec_helper.rb
|