jenkins_api_client 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/jenkins_api_client.gemspec +3 -3
- data/lib/jenkins_api_client/version.rb +1 -1
- data/lib/jenkins_api_client/view.rb +14 -0
- data/spec/unit_tests/view_spec.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cca7880ea1f165f17a95359673aa232cbf3988d
|
4
|
+
data.tar.gz: fefde26f943d42e4d26e5f1565b5a2da6abbbd4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07effbc0cfc48c29b1630e483e88b4ab14e7246278787ed452cfe277f33861fcac0653b3c9996e873222781dbbdf1f8d69c3f71e1b6e05713db880e3990d50c0
|
7
|
+
data.tar.gz: 6dafbc1b4eed8f3070575ba08b9ba2d920353b9060b47e9b1565d691202a60d3ad0e005401572702321e76d2573194f9a37dba7abb6a85152c71c1a3c98e4820
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ CHANGELOG
|
|
4
4
|
upcoming
|
5
5
|
--------
|
6
6
|
|
7
|
+
v1.4.2 [25-OCT-2015]
|
8
|
+
----------------------
|
9
|
+
* [#188][] Added ability view jobs in a view with details. Credir: [@Tyrael][]
|
10
|
+
|
7
11
|
v1.4.1 [21-SEP-2015]
|
8
12
|
----------------------
|
9
13
|
* [#191][] Add dynamic depth support for node attributes. Credit: [@stjohnjohnson][]
|
@@ -330,10 +334,12 @@ v0.0.1 [15-OCT-2012]
|
|
330
334
|
[#176]: https://github.com/arangamani/jenkins_api_client/issues/176
|
331
335
|
[#177]: https://github.com/arangamani/jenkins_api_client/issues/177
|
332
336
|
[#179]: https://github.com/arangamani/jenkins_api_client/issues/179
|
337
|
+
[#188]: https://github.com/arangamani/jenkins_api_client/issues/188
|
333
338
|
[#191]: https://github.com/arangamani/jenkins_api_client/issues/191
|
334
339
|
[@AndrewHanes]: https://github.com/AndrewHanes
|
335
340
|
[@Loa]: https://github.com/Loa
|
336
341
|
[@Niarfe]: https://github.com/Niarfe
|
342
|
+
[@Tyrael]: https://github.com/Tyrael
|
337
343
|
[@bkon]: https://github.com/bkon
|
338
344
|
[@bobbrez]: https://github.com/bobbrez
|
339
345
|
[@brettporter]: https://github.com/brettporter
|
data/jenkins_api_client.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: jenkins_api_client 1.4.
|
5
|
+
# stub: jenkins_api_client 1.4.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "jenkins_api_client"
|
9
|
-
s.version = "1.4.
|
9
|
+
s.version = "1.4.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Kannan Manickam"]
|
14
|
-
s.date = "2015-
|
14
|
+
s.date = "2015-10-25"
|
15
15
|
s.description = "\nThis is a simple and easy-to-use Jenkins Api client with features focused on\nautomating Job configuration programaticaly and so forth"
|
16
16
|
s.email = ["arangamani.kannan@gmail.com"]
|
17
17
|
s.executables = ["jenkinscli"]
|
@@ -221,6 +221,20 @@ module JenkinsApi
|
|
221
221
|
job_names
|
222
222
|
end
|
223
223
|
|
224
|
+
# List jobs in view along with their details
|
225
|
+
#
|
226
|
+
# @param [String] view_name
|
227
|
+
#
|
228
|
+
# @return [Array<Hash>] the details of jobs in the specified view
|
229
|
+
#
|
230
|
+
def list_jobs_with_details(view_name)
|
231
|
+
@logger.info "Obtaining the jobs present in view '#{view_name}'"
|
232
|
+
raise "The view #{view_name} doesn't exists on the server"\
|
233
|
+
unless exists?(view_name)
|
234
|
+
response_json = @client.api_get_request("/view/#{path_encode view_name}")
|
235
|
+
response_json["jobs"]
|
236
|
+
end
|
237
|
+
|
224
238
|
# Add a job to view
|
225
239
|
#
|
226
240
|
# @param [String] view_name
|
@@ -98,6 +98,24 @@ describe JenkinsApi::Client::View do
|
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
|
+
describe "#list_jobs_with_details" do
|
102
|
+
it "lists all jobs with details in the given view" do
|
103
|
+
@client.should_receive(:api_get_request).with("", "tree=views[name]").and_return(@sample_views_json)
|
104
|
+
@client.should_receive(:api_get_request).with("/view/test_view").and_return(
|
105
|
+
@sample_view_json)
|
106
|
+
response = @view.list_jobs_with_details("test_view")
|
107
|
+
response.class.should == Array
|
108
|
+
response.size.should == @sample_view_json["jobs"].size
|
109
|
+
end
|
110
|
+
|
111
|
+
it "raises an error if called on a non-existent view" do
|
112
|
+
@client.should_receive(:api_get_request).with("", "tree=views[name]").and_return(@sample_views_json)
|
113
|
+
expect(
|
114
|
+
lambda { @view.list_jobs_with_details("i_am_not_there") }
|
115
|
+
).to raise_error
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
101
119
|
describe "#add_job" do
|
102
120
|
it "adds the specified job to the specified view" do
|
103
121
|
@client.should_receive(:api_post_request)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jenkins_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kannan Manickam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|