jenkins_api_client 1.0.0 → 1.0.1

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: 646dcb2b3b87533a3d3257a22b72b702efc3ebda
4
- data.tar.gz: 87704990a77cc24b3eb6bee80c1a17837af36656
3
+ metadata.gz: 3897dc16888185c70f0fe4c10ebe276926d993fd
4
+ data.tar.gz: aa5e4de611aebea6b1cce304b30f518b7804219a
5
5
  SHA512:
6
- metadata.gz: 222f14e72886e6f13dea87e5cf98a24bd41ae1b1f655960b0245422cdcb340a8ba01ab72e0f327f5f39fb8cc0870c1246a5d0082a7ca52c08597e1dc44048e4f
7
- data.tar.gz: 74573b0aaccfe06fe557c7d2c34500ff9e863c8af4bf3af7dcb7e4f2153e64c0361353e13944ee4e8d0be0fe0c802c8d1d84006331f4841bb6b2f6d6cbd720ca
6
+ metadata.gz: 9d9f39b820ddbc284a1c28aeae2268b3bc4116869e89bf84f6c604305c869f8005f1754c0264d2f6f8bfec0e424bf599b6c9dfe20adab709279b884fb66e5867
7
+ data.tar.gz: 9fbde3bbdb855aa297968da8153ebd7ffc16d1b9eeefa914aa2be69315a83969f4c8f30829b87ce5a5096ccdd36756157cc123c1e8152cda76dd8e4e7834c982
data/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.0.0
4
+ - 2.1.2
5
5
  - 1.9.3
6
6
 
7
7
  script:
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ CHANGELOG
4
4
  upcoming
5
5
  --------
6
6
 
7
+ v1.0.1 [16-JUL-2014]
8
+ ----------------------
9
+ * Add `charset=UTF-8` along with content_type when posting data to Jenkins.
10
+
7
11
  v1.0.0 [23-JUN-2014]
8
12
  ----------------------
9
13
  * Ruby 1.8 is not supported anymore.
@@ -288,4 +292,4 @@ v0.0.1 [15-OCT-2012]
288
292
  [@spikegrobstein]: https://github.com/spikegrobstein
289
293
  [@sunaot]: https://github.com/sunaot
290
294
  [@tjhanley]: https://github.com/tjhanley
291
- [@woodbusy]: https://github.com/woodbusy
295
+ [@woodbusy]: https://github.com/woodbusy
@@ -22,6 +22,6 @@
22
22
 
23
23
  :password: my_password
24
24
 
25
- # The priviate key file for Jenkins CLI authentication
25
+ # The private key file for Jenkins CLI authentication
26
26
  # remember to upload the public key to http://#{server_ip}:#{server_port}/user/#{my_username}/configure
27
27
  :identity_file: ~/.ssh/id_rsa
@@ -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.0.0 ruby lib
5
+ # stub: jenkins_api_client 1.0.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "jenkins_api_client"
9
- s.version = "1.0.0"
9
+ s.version = "1.0.1"
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 = "2014-06-21"
14
+ s.date = "2014-07-16"
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"]
@@ -403,11 +403,11 @@ module JenkinsApi
403
403
  # @return [String] Response code returned from Jenkins
404
404
  #
405
405
  def post_config(url_prefix, xml)
406
- post_data(url_prefix, xml, 'application/xml')
406
+ post_data(url_prefix, xml, 'application/xml;charset=UTF-8')
407
407
  end
408
408
 
409
409
  def post_json(url_prefix, json)
410
- post_data(url_prefix, json, 'application/json')
410
+ post_data(url_prefix, json, 'application/json;charset=UTF-8')
411
411
  end
412
412
 
413
413
  def post_data(url_prefix, data, content_type)
@@ -27,7 +27,7 @@ module JenkinsApi
27
27
  # Minor version of the gem
28
28
  MINOR = 0
29
29
  # Tiny version of the gem used for patches
30
- TINY = 0
30
+ TINY = 1
31
31
  # Used for pre-releases
32
32
  PRE = nil
33
33
  # Version String of Jenkins API Client.
@@ -195,6 +195,31 @@ describe JenkinsApi::Client do
195
195
  @client.respond_to?(:post_config).should be_true
196
196
  @client.method(:post_config).parameters.size.should == 2
197
197
  end
198
+
199
+ it "sets the content type with charset as UTF-8 for the multi-byte content" do
200
+ url_prefix = '/prefix'
201
+ xml = '<dummy>dummy</dummy>'
202
+ content_type = 'application/xml;charset=UTF-8'
203
+
204
+ expect(@client).to receive(:post_data).with(url_prefix, xml, content_type)
205
+ @client.post_config(url_prefix, xml)
206
+ end
207
+ end
208
+
209
+ describe "#post_json" do
210
+ it "is defined and should accept url_prefix and json" do
211
+ @client.respond_to?(:post_json).should be_true
212
+ @client.method(:post_json).parameters.size.should == 2
213
+ end
214
+
215
+ it "sets the content type with charset as UTF-8 for the multi-byte content" do
216
+ url_prefix = '/prefix'
217
+ json = '{ "dummy": "dummy" }'
218
+ content_type = 'application/json;charset=UTF-8'
219
+
220
+ expect(@client).to receive(:post_data).with(url_prefix, json, content_type)
221
+ @client.post_json(url_prefix, json)
222
+ end
198
223
  end
199
224
 
200
225
  describe "#get_jenkins_version" do
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.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kannan Manickam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-23 00:00:00.000000000 Z
11
+ date: 2014-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri