chef-infra-api 0.10.7 → 0.10.10

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: 93414a4eeec6fdb16fbccda6e9b4c5f320d9e2dbd6f498a3076ac309eea0a36a
4
- data.tar.gz: 12c5c174fc5473780ec0dae6605ffbe403fd8f2057c8c401366a36e0326c8878
3
+ metadata.gz: c8ca98919801b5c0d0baf4ef0e2b4523efb24b3ee2aa65e04fc9d5473ec6c373
4
+ data.tar.gz: eff96d984676e726e4a4c0a5b67b9dca76800a4e373d71b8e50b0e5f0fec9b58
5
5
  SHA512:
6
- metadata.gz: 2c135a436d049f88163b759c8e02e845b2fee55a2b844c1192b108396b09c9be0b2d1fb3679fcc1b76d0ca29da4bea1a83da81bc44d7755009814fc72fb815d7
7
- data.tar.gz: 3517d220d50b1b4ceac637fad1a80beeadad9db05224d8557ab0cafb6842b890561c8e5563fc26b78438e8f41caedbb4f276ba8554fad4359a626bb32cc95554
6
+ metadata.gz: 1647ff4a3dda7b6e8179417cfbb0c7ba1c56cc0707848e8d65ea4046d6c212c3c0c2e4331e2560a9773e64f261b56c35c93a4c8bf3de1a1e98611333719d25ef
7
+ data.tar.gz: c6f799df264a08315a6688887be7da5a2c5b516e4b24645fc54d22470c3faac7e1669002b6ae286a073efe6a70a0571ade14c63e585c20d9dcab87a412381c32
@@ -1,5 +1,5 @@
1
- require "json"
2
- require "pathname"
1
+ require "json" unless defined?(JSON)
2
+ require "pathname" unless defined?(Pathname)
3
3
  require_relative "chef-api/log"
4
4
  require_relative "chef-api/version"
5
5
 
@@ -1,7 +1,7 @@
1
- require "base64"
2
- require "digest"
3
- require "openssl"
4
- require "time"
1
+ require "base64" unless defined?(Base64)
2
+ require "digest" unless defined?(Digest)
3
+ require "openssl" unless defined?(OpenSSL)
4
+ require "time" unless defined?(Time)
5
5
 
6
6
  #
7
7
  # DEBUG steps:
@@ -1,7 +1,7 @@
1
- require "net/http"
2
- require "net/https"
3
- require "openssl"
4
- require "uri"
1
+ require "net/http" unless defined?(Net::HTTP)
2
+ require "openssl" unless defined?(OpenSSL)
3
+ require "uri" unless defined?(URI)
4
+ require "cgi" unless defined?(CGI)
5
5
 
6
6
  module ChefAPI
7
7
  #
@@ -376,7 +376,7 @@ module ChefAPI
376
376
  #
377
377
  def to_query_string(hash)
378
378
  hash.map do |key, value|
379
- "#{URI.escape(key.to_s)}=#{URI.escape(value.to_s)}"
379
+ "#{CGI.escape(key.to_s)}=#{CGI.escape(value.to_s)}"
380
380
  end.join("&")[/.+/]
381
381
  end
382
382
 
@@ -1,6 +1,6 @@
1
1
  require_relative "version"
2
- require "pathname"
3
- require "json"
2
+ require "pathname" unless defined?(Pathname)
3
+ require "json" unless defined?(JSON)
4
4
 
5
5
  module ChefAPI
6
6
  module Defaults
@@ -1,4 +1,4 @@
1
- require "erb"
1
+ require "erb" unless defined?(Erb)
2
2
 
3
3
  module ChefAPI
4
4
  module Error
@@ -1,5 +1,5 @@
1
- require "cgi"
2
- require "mime/types"
1
+ require "cgi" unless defined?(CGI)
2
+ require "mime/types" unless defined?(MIME::Types)
3
3
 
4
4
  module ChefAPI
5
5
  module Multipart
@@ -1,6 +1,8 @@
1
1
  module ChefAPI
2
2
  class Resource::Base
3
3
  class << self
4
+ require "cgi" unless defined?(CGI)
5
+
4
6
  # Including the Enumberable module gives us magic
5
7
  include Enumerable
6
8
 
@@ -512,7 +514,7 @@ module ChefAPI
512
514
  raise Error::MissingURLParameter.new(param: key)
513
515
  end
514
516
 
515
- URI.escape(value)
517
+ CGI.escape(value)
516
518
  end.sub(%r{^/}, "") # Remove leading slash
517
519
  end
518
520
 
@@ -1,5 +1,7 @@
1
1
  module ChefAPI
2
2
  class Resource::User < Resource::Base
3
+ require "cgi" unless defined?(CGI)
4
+
3
5
  collection_path "/users"
4
6
 
5
7
  schema do
@@ -38,7 +40,7 @@ module ChefAPI
38
40
  # HEC/EC returns a slightly different response than OSC/CZ
39
41
  if users.is_a?(Array)
40
42
  users.each do |info|
41
- name = URI.escape(info["user"]["username"])
43
+ name = CGI.escape(info["user"]["username"])
42
44
  response = connection.get("/users/#{name}")
43
45
  result = from_json(response, prefix)
44
46
 
@@ -1,3 +1,3 @@
1
1
  module ChefAPI
2
- VERSION = "0.10.7".freeze
2
+ VERSION = "0.10.10".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-infra-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.7
4
+ version: 0.10.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-06-12 00:00:00.000000000 Z
12
+ date: 2020-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mixlib-log