jenkins_api_client 1.4.1 → 1.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 415cf1e5cefb2d7137f0db1f7030613aa0b8af0f
4
- data.tar.gz: 5b0c768d924f1ef26518bf8d4e1850da1042100f
3
+ metadata.gz: 8cca7880ea1f165f17a95359673aa232cbf3988d
4
+ data.tar.gz: fefde26f943d42e4d26e5f1565b5a2da6abbbd4a
5
5
  SHA512:
6
- metadata.gz: c01e9279b80d45676605920a547f9cd6a793dfbcb76a1257ac7f44cfc0a54c44835b5c7caecc7d2b46b7677464be95a7710188ab15f8ecbf7ced21c0a0cbc5eb
7
- data.tar.gz: b16bed4ab466c62d9b3f1165e80e291555c9885e508392b09e7fa88dd2f573a7d977e552804479b6e4788c59acfa3acc6744d6fbe1c3279f1b86e9b13e14b60f
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
@@ -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.1 ruby lib
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.1"
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-09-21"
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"]
@@ -27,7 +27,7 @@ module JenkinsApi
27
27
  # Minor version of the gem
28
28
  MINOR = 4
29
29
  # Tiny version of the gem used for patches
30
- TINY = 1
30
+ TINY = 2
31
31
  # Used for pre-releases
32
32
  PRE = nil
33
33
  # Version String of Jenkins API Client.
@@ -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.1
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-09-21 00:00:00.000000000 Z
11
+ date: 2015-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri