artifactory 3.0.13 → 3.0.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17f2e20aaeb0c7dde0f7f46d3fbd780cd1e8818f7a72d10bbc68bc959362dfe5
4
- data.tar.gz: bd0ca811f01c5958e2e8565163b5af0983dbd19a51c51bfd42ac4c5a818d1add
3
+ metadata.gz: 983231b7f83eb602f79fe980c3ca62112aa613e88a82085859eb381eb4fbbead
4
+ data.tar.gz: 3a5d87c94c5930e7624a8e74541d5c4f1be1a60a60ef3999e2936b454f4d650a
5
5
  SHA512:
6
- metadata.gz: f28c346e5ba840570ae0e96a1a077a4ab0ea86c89526dfc2e03ac9b165d861d099f42179a2f59313570eba55bc09af61bfde7f4993435b2db61592175731d6ab
7
- data.tar.gz: 5570f6b4d16e61ed9350243dc0811bf171bc872a35abdf26d0b3fffc549bfa4c694e1a1922251e041fa029ecc9137fd21b018a96708e20e275ecca245319acc5
6
+ metadata.gz: 2f685dc73ed256280cdb6451d81e4629720be840efcb8cda6198d97f6363b176f2c4978d85a295b6228f9bf5a3da4c9d18307e5b9f98c19e6359ebc4a577657a
7
+ data.tar.gz: 3c9831c12e78dce22c0dd87964e2bb270d43c02c44c0389d65f4e1363cbadb1967543f0e81faab67a97e360ccf86e8786fd4e0b09a25f7757263581382c6dfac
@@ -14,10 +14,10 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "cgi"
18
- require "json"
19
- require "net/http"
20
- require "uri"
17
+ require "cgi" unless defined?(CGI)
18
+ require "json" unless defined?(JSON)
19
+ require "net/http" unless defined?(Net::HTTP)
20
+ require "uri" unless defined?(URI)
21
21
 
22
22
  module Artifactory
23
23
  #
@@ -232,7 +232,8 @@ module Artifactory
232
232
 
233
233
  # Apply SSL, if applicable
234
234
  if uri.scheme == "https"
235
- require "net/https" unless defined?(Net::HTTPS)
235
+ require "net/http" unless defined?(Net::HTTP)
236
+ require "openssl" unless defined?(Net::HTTPS)
236
237
 
237
238
  # Turn on SSL
238
239
  connection.use_ssl = true
@@ -258,8 +259,16 @@ module Artifactory
258
259
 
259
260
  if block_given?
260
261
  http.request(request) do |response|
261
- response.read_body do |chunk|
262
- yield chunk
262
+ case response
263
+ when Net::HTTPRedirection
264
+ redirect = response["location"]
265
+ request(verb, redirect, data, headers, &block)
266
+ when Net::HTTPSuccess
267
+ response.read_body do |chunk|
268
+ yield chunk
269
+ end
270
+ else
271
+ error(response)
263
272
  end
264
273
  end
265
274
  else
@@ -14,8 +14,8 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "tempfile"
18
- require "time"
17
+ require "tempfile" unless defined?(Tempfile)
18
+ require "time" unless defined?(Time.zone_offset)
19
19
 
20
20
  module Artifactory
21
21
  class Resource::Artifact < Resource::Base
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "rexml/document"
17
+ require "rexml/document" unless defined?(REXML::Document)
18
18
 
19
19
  module Artifactory
20
20
  class Resource::Backup < Resource::Base
@@ -14,9 +14,9 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "cgi"
18
- require "json"
19
- require "uri"
17
+ require "cgi" unless defined?(CGI)
18
+ require "json" unless defined?(JSON)
19
+ require "uri" unless defined?(URI)
20
20
 
21
21
  module Artifactory
22
22
  class Resource::Base
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "time"
17
+ require "time" unless defined?(Time.zone_offset)
18
18
 
19
19
  module Artifactory
20
20
  class Resource::Build < Resource::Base
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "time"
17
+ require "time" unless defined?(Time.zone_offset)
18
18
 
19
19
  module Artifactory
20
20
  class Resource::BuildComponent < Resource::Base
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "rexml/document"
17
+ require "rexml/document" unless defined?(REXML::Document)
18
18
 
19
19
  module Artifactory
20
20
  class Resource::Layout < Resource::Base
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "rexml/document"
17
+ require "rexml/document" unless defined?(REXML::Document)
18
18
 
19
19
  module Artifactory
20
20
  class Resource::LDAPSetting < Resource::Base
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "rexml/document"
17
+ require "rexml/document" unless defined?(REXML::Document)
18
18
 
19
19
  module Artifactory
20
20
  class Resource::MailServer < Resource::Base
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "rexml/document"
17
+ require "rexml/document" unless defined?(REXML::Document)
18
18
 
19
19
  module Artifactory
20
20
  class Resource::URLBase < Resource::Base
@@ -15,5 +15,5 @@
15
15
  #
16
16
 
17
17
  module Artifactory
18
- VERSION = "3.0.13".freeze
18
+ VERSION = "3.0.17".freeze
19
19
  end
data/lib/artifactory.rb CHANGED
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "pathname"
17
+ require "pathname" unless defined?(Pathname)
18
18
  require_relative "artifactory/version"
19
19
 
20
20
  module Artifactory
@@ -59,7 +59,7 @@ module Artifactory
59
59
  # @return [Pathname]
60
60
  #
61
61
  def root
62
- @root ||= Pathname.new(File.expand_path("../../", __FILE__))
62
+ @root ||= Pathname.new(File.expand_path("..", __dir__))
63
63
  end
64
64
 
65
65
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artifactory
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.13
4
+ version: 3.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Release Engineering Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-15 00:00:00.000000000 Z
11
+ date: 2021-10-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Ruby client for Artifactory
14
14
  email: releng@chef.io
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  requirements: []
65
- rubygems_version: 3.0.3
65
+ rubygems_version: 3.1.4
66
66
  signing_key:
67
67
  specification_version: 4
68
68
  summary: Artifactory is a simple, lightweight Ruby client for interacting with the