jenkins2-api 1.0.15 → 1.0.17

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
- SHA1:
3
- metadata.gz: 7818ba111c5d81543addda66980d367fc24c70a5
4
- data.tar.gz: 3837cccb393319e4fd1229edd6858fb448b4da7f
2
+ SHA256:
3
+ metadata.gz: b8f8387235bc79d14b363e9112d548612e6de47619d30206a5613435dc8c7854
4
+ data.tar.gz: 0f6312936b46c1f9d1cfbb17adb43f81e2aa0ec01727a25388927aae3c901f01
5
5
  SHA512:
6
- metadata.gz: 9955b2662594d644f7044f23a7458d4d0d12b70f880c1a914a4b0c21b7d03e1d79585d619247b634aab688a4af12df9158b2c83fbcf1d9b51688b5f4f7ea11f0
7
- data.tar.gz: 1b028e3a5ddd4f9dd7c229a68c3e772c353d17a6647b2ab05f1a69eb4397123194ad62ebda9475799eb4fb7eff471f387be711bdd2e1f1d8c046b55a599ff50d
6
+ metadata.gz: 30ec4147422b79b321f57e2ba4df7fda87ffc07c037b582435258b6d4ee67416002081e1345218fead43cda6e4715a3fd56d89a18fe457d6b2c018f89e4848db
7
+ data.tar.gz: adf0e7b3c6dbd226749ef7bc50dea960b2863164b179d86edfeed10ff83ccd158e6d3a825d49943780f70fe2540116b1b2fff4c2ba588495052bf2d1ad1aa1dc
@@ -64,7 +64,7 @@ module Jenkins2API
64
64
  # ==== Params:
65
65
  # +method+:: +:post+ or +:get+
66
66
  # +path+:: Path to the Jenkins resource (e.g.: +/job/my-job/+)
67
- # +response_type+:: +:json+ or +:raw+
67
+ # +response_type+:: +:json+, +:xml+ or +:raw+
68
68
  # +opts+:: sym options to pass to the endpoint. Applicable only if +:post+
69
69
  def api_request(method, path, response_type = :json, **opts)
70
70
  req = new_request(method, path, response_type, opts)
@@ -85,10 +85,11 @@ module Jenkins2API
85
85
  # Creates a new request for the API call
86
86
  # with default and required values
87
87
  def new_request(method, path, response_type, **opts)
88
- response_type = :json unless %i[json raw].include?(response_type)
88
+ response_type = :json unless %i[json raw xml].include?(response_type)
89
89
 
90
90
  parts = [@server, URI.escape(path)]
91
91
  parts << 'api/json' if response_type == :json
92
+ parts << 'api/xml' if response_type == :xml
92
93
  uri = URI(File.join(parts))
93
94
  uri.query = URI.encode_www_form(opts)
94
95
 
@@ -28,7 +28,7 @@ module Jenkins2API
28
28
  # +name+:: Name of the Job
29
29
  # +build_id+:: ID of the build
30
30
  def test_results(name, build_id)
31
- @client.api_request(:get, "/job/#{name}/#{build_id}/testReport")
31
+ @client.api_request(:get, "/job/#{name}/#{build_id}/testReport", :xml)
32
32
  end
33
33
 
34
34
  # Get +console log+ for a specific build as text
@@ -31,6 +31,16 @@ module Jenkins2API
31
31
  @client.api_request(:get, "/job/#{name}")['builds']
32
32
  end
33
33
 
34
+ # Get all available sub-jobs for a specific job
35
+ #
36
+ # ==== Params:
37
+ # +name+:: Name of the Job
38
+ #
39
+ # Returns with an array of jobs
40
+ def jobs(name)
41
+ @client.api_request(:get, "/job/#{name}")['jobs']
42
+ end
43
+
34
44
  # Trigger a build on a specific job
35
45
  #
36
46
  # ==== Params:
@@ -1,5 +1,5 @@
1
1
  module Jenkins2API
2
2
  # Current version to publish
3
3
  # Gemspec also uses this constant
4
- VERSION = '1.0.15'.freeze
4
+ VERSION = '1.0.17'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jenkins2-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Balazs Nadasdi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-03 00:00:00.000000000 Z
11
+ date: 2020-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '12'
31
34
  - - ">="
32
35
  - !ruby/object:Gem::Version
33
- version: '12.0'
36
+ version: 12.3.3
34
37
  type: :development
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '12'
38
44
  - - ">="
39
45
  - !ruby/object:Gem::Version
40
- version: '12.0'
46
+ version: 12.3.3
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: rdoc
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -144,7 +150,7 @@ homepage: https://yitsushi.github.io/jenkins2-api/
144
150
  licenses:
145
151
  - MIT
146
152
  metadata: {}
147
- post_install_message:
153
+ post_install_message:
148
154
  rdoc_options: []
149
155
  require_paths:
150
156
  - lib
@@ -159,16 +165,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
165
  - !ruby/object:Gem::Version
160
166
  version: '0'
161
167
  requirements: []
162
- rubyforge_project:
163
- rubygems_version: 2.6.11
164
- signing_key:
168
+ rubygems_version: 3.0.1
169
+ signing_key:
165
170
  specification_version: 4
166
171
  summary: API client for Jenkins 2.
167
172
  test_files:
168
- - spec/features/build_spec.rb
173
+ - spec/spec_helper.rb
169
174
  - spec/features/client_spec.rb
170
175
  - spec/features/job_spec.rb
171
- - spec/spec_helper.rb
176
+ - spec/features/build_spec.rb
172
177
  - spec/support/fake_jenkins.rb
173
- - spec/support/fixtures/job_list.json
174
178
  - spec/support/fixtures/latest_build.json
179
+ - spec/support/fixtures/job_list.json