summaryrefslogtreecommitdiff
path: root/lib/chef/http
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-05-20 18:05:36 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-05-20 18:05:36 -0700
commit9dbdb769bfd963f82eb4bfea53c83501d0193766 (patch)
treedaba4babc4ba8eb73bd765783dc8a53a7abff6be /lib/chef/http
parent248344cfe776b66a8da563c985e34d9c99967791 (diff)
downloadchef-9dbdb769bfd963f82eb4bfea53c83501d0193766.tar.gz
This hits the ones that are most frequently required.lcg/require-idempotency
Stops the kernel from scanning through all the activated gems every time in order to resolve names into pathnames. See rubygems/rubygems#2762 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/http')
-rw-r--r--lib/chef/http/authenticator.rb2
-rw-r--r--lib/chef/http/basic_client.rb4
-rw-r--r--lib/chef/http/cookie_jar.rb2
-rw-r--r--lib/chef/http/http_request.rb6
-rw-r--r--lib/chef/http/ssl_policies.rb2
-rw-r--r--lib/chef/http/validate_content_length.rb2
6 files changed, 9 insertions, 9 deletions
diff --git a/lib/chef/http/authenticator.rb b/lib/chef/http/authenticator.rb
index 6b059c9733..1e302f5173 100644
--- a/lib/chef/http/authenticator.rb
+++ b/lib/chef/http/authenticator.rb
@@ -18,7 +18,7 @@
require_relative "auth_credentials"
require_relative "../exceptions"
-require "openssl"
+require "openssl" unless defined?(OpenSSL)
class Chef
class HTTP
diff --git a/lib/chef/http/basic_client.rb b/lib/chef/http/basic_client.rb
index a599f2219e..3cbfc8c968 100644
--- a/lib/chef/http/basic_client.rb
+++ b/lib/chef/http/basic_client.rb
@@ -20,8 +20,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require "uri"
-require "net/http"
+require "uri" unless defined?(URI)
+require "net/http" unless defined?(Net::HTTP)
require_relative "ssl_policies"
require_relative "http_request"
diff --git a/lib/chef/http/cookie_jar.rb b/lib/chef/http/cookie_jar.rb
index 4908fde0c9..5d54fa2c4d 100644
--- a/lib/chef/http/cookie_jar.rb
+++ b/lib/chef/http/cookie_jar.rb
@@ -20,7 +20,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require "singleton"
+require "singleton" unless defined?(Singleton)
class Chef
class HTTP
diff --git a/lib/chef/http/http_request.rb b/lib/chef/http/http_request.rb
index a8549b32da..566d05fa84 100644
--- a/lib/chef/http/http_request.rb
+++ b/lib/chef/http/http_request.rb
@@ -20,8 +20,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require "uri"
-require "net/http"
+require "uri" unless defined?(URI)
+require "net/http" unless defined?(Net::HTTP)
require_relative "../dist"
# To load faster, we only want ohai's version string.
@@ -30,7 +30,7 @@ require_relative "../dist"
begin
require "ohai/version" # used in user agent string.
rescue LoadError
- require "ohai"
+ require "ohai" unless defined?(Ohai::System)
end
require_relative "../version"
diff --git a/lib/chef/http/ssl_policies.rb b/lib/chef/http/ssl_policies.rb
index 2708e5b3b1..3f7dd34404 100644
--- a/lib/chef/http/ssl_policies.rb
+++ b/lib/chef/http/ssl_policies.rb
@@ -21,7 +21,7 @@
# limitations under the License.
#
-require "openssl"
+require "openssl" unless defined?(OpenSSL)
require_relative "../util/path_helper"
class Chef
diff --git a/lib/chef/http/validate_content_length.rb b/lib/chef/http/validate_content_length.rb
index e24ebc0dd5..1b1a8a398a 100644
--- a/lib/chef/http/validate_content_length.rb
+++ b/lib/chef/http/validate_content_length.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require "pp"
+require "pp" unless defined?(PP)
require_relative "../log"
class Chef