jenkins_api_client 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,6 +4,12 @@ CHANGELOG
4
4
  upcoming
5
5
  --------
6
6
 
7
+ v0.12.1 [25-JUN-2013]
8
+ ----------------------
9
+ * Fixed a bug where the SSL support was not working properly with Ruby
10
+ 1.8.7/JRuby 1.6. Credit: @brettporter (For more info:
11
+ https://github.com/arangamani/jenkins_api_client/pull/85)
12
+
7
13
  v0.12.0 [18-JUN-2013]
8
14
  ----------------------
9
15
  * Authentication is now optional as not all Jenkins instances have
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jenkins_api_client}
8
- s.version = "0.12.0"
8
+ s.version = "0.12.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kannan Manickam"]
12
- s.date = %q{2013-06-19}
12
+ s.date = %q{2013-06-26}
13
13
  s.default_executable = %q{jenkinscli}
14
14
  s.description = %q{
15
15
  This is a simple and easy-to-use Jenkins Api client with features focused on
@@ -23,6 +23,7 @@
23
23
  require 'rubygems'
24
24
  require 'json'
25
25
  require 'net/http'
26
+ require 'net/https'
26
27
  require 'nokogiri'
27
28
  require 'base64'
28
29
  require "mixlib/shellout"
@@ -173,18 +174,26 @@ module JenkinsApi
173
174
  def make_http_request(request, follow_redirect = @follow_redirects)
174
175
  request.basic_auth @username, @password if @username
175
176
 
176
- if @server_url
177
- http = Net::HTTP.new(@server_uri.host, @server_uri.port)
178
- http.use_ssl = true if @ssl
179
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE if @ssl
180
- response = http.request(request)
177
+ if @server_uri
178
+ host = @server_uri.host
179
+ port = @server_uri.port
181
180
  else
182
- Net::HTTP.start(
183
- @server_ip, @server_port, @proxy_ip, @proxy_port, :use_ssl => @ssl
184
- ) do |http|
185
- response = http.request(request)
186
- end
181
+ host = @server_ip
182
+ port = @server_port
183
+ end
184
+
185
+ if @proxy_ip
186
+ http = Net::HTTP::Proxy(@proxy_ip, @proxy_port).new(host, port)
187
+ else
188
+ http = Net::HTTP.new(host, port)
187
189
  end
190
+
191
+ if @ssl
192
+ http.use_ssl = true
193
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
194
+ end
195
+
196
+ response = http.request(request)
188
197
  case response
189
198
  when Net::HTTPRedirection then
190
199
  # If we got a redirect request, follow it (if flag set), but don't
@@ -27,7 +27,7 @@ module JenkinsApi
27
27
  # Minor version of the gem
28
28
  MINOR = 12
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.
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 12
8
- - 0
9
- version: 0.12.0
8
+ - 1
9
+ version: 0.12.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kannan Manickam
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2013-06-19 00:00:00 -07:00
17
+ date: 2013-06-26 00:00:00 -07:00
18
18
  default_executable: jenkinscli
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency