summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/mixin')
-rw-r--r--lib/chef/mixin/openssl_helper.rb5
-rw-r--r--lib/chef/mixin/template.rb4
-rw-r--r--lib/chef/mixin/uris.rb4
3 files changed, 5 insertions, 8 deletions
diff --git a/lib/chef/mixin/openssl_helper.rb b/lib/chef/mixin/openssl_helper.rb
index db422175bb..1d50523df8 100644
--- a/lib/chef/mixin/openssl_helper.rb
+++ b/lib/chef/mixin/openssl_helper.rb
@@ -14,15 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+autoload :OpenSSL, "openssl"
class Chef
module Mixin
# various helpers for use with openssl. Currently used by the openssl_* resources
module OpenSSLHelper
- def self.included(_base)
- require "openssl" unless defined?(::OpenSSL)
- end
-
# determine the key filename from the cert filename
# @param [String] cert_filename the path to the certfile
# @return [String] the path to the keyfile
diff --git a/lib/chef/mixin/template.rb b/lib/chef/mixin/template.rb
index d72bfe9e3a..a369cae9e5 100644
--- a/lib/chef/mixin/template.rb
+++ b/lib/chef/mixin/template.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require "tempfile" unless defined?(Tempfile)
-require "erubis" unless defined?(Erubis)
+autoload :Tempfile, "tempfile"
+autoload :Erubis, "erubis"
class Chef
module Mixin
diff --git a/lib/chef/mixin/uris.rb b/lib/chef/mixin/uris.rb
index ab33c6791e..74c2af73d8 100644
--- a/lib/chef/mixin/uris.rb
+++ b/lib/chef/mixin/uris.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require "uri" unless defined?(URI)
-require "addressable/uri" unless defined?(Addressable::URI)
+autoload :URI, "uri"
+autoload :Addressable, "addressable/uri"
class Chef
module Mixin