chef-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: d924ca79422311f6742cb0c5a247faec5384e9dce483e09137011053edcd0e0b
4
- data.tar.gz: b712903d1f9081794bb836ce4d2109a903fa53ea1ff99b337b91192cef9a16cd
3
+ metadata.gz: 9190cfe613a46da5a280ffc69ba7f58a0a955a354e3272c166f8e76c8bbbbc49
4
+ data.tar.gz: a8851cab2284d7935300c90883eb27ffc3c88673cb1d3566528fb37167a120de
5
5
  SHA512:
6
- metadata.gz: a16fd64fa33993a05a5e2e28dbfa98558103417ba2ea2d6f75743d4ed3bc1e4d6d626ba9b130ecf655d3142185da45a420e126152f44f67c8477dd1c412f998a
7
- data.tar.gz: 5c2f16382bb8086d9998f3f20edcac97df9600459b4c18f06e74b82c003c161f4c980875a8f3be9c098f4794779d5a571e32041acac6f65b891ba9061f784af8
6
+ metadata.gz: 5275c0487d47da3cb81c1a9eff0bb07cdd5a71fe24534dff2b5e78e547db9c8c2e65b63fc817b0041f952770ea10a97e5438083829ed4c0a76439a37b225970e
7
+ data.tar.gz: bf8f4fb60b9c8da3a4071da529f4b54093bf73c80d0e806594f6ed741f4d8df8e2dc6ddd69bcc4fae9779c65a2d4f305d73919fc19dbcd7d19a1343cff114ad1
@@ -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-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