summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
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/mixin
parent248344cfe776b66a8da563c985e34d9c99967791 (diff)
downloadchef-lcg/require-idempotency.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/mixin')
-rw-r--r--lib/chef/mixin/checksum.rb2
-rw-r--r--lib/chef/mixin/homebrew_user.rb2
-rw-r--r--lib/chef/mixin/shell_out.rb2
-rw-r--r--lib/chef/mixin/template.rb4
-rw-r--r--lib/chef/mixin/uris.rb4
5 files changed, 7 insertions, 7 deletions
diff --git a/lib/chef/mixin/checksum.rb b/lib/chef/mixin/checksum.rb
index 74607da04b..5394c5ea48 100644
--- a/lib/chef/mixin/checksum.rb
+++ b/lib/chef/mixin/checksum.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require "digest/sha2"
+require "digest/sha2" unless defined?(Digest::SHA2)
require_relative "../digester"
class Chef
diff --git a/lib/chef/mixin/homebrew_user.rb b/lib/chef/mixin/homebrew_user.rb
index 9e619c3c47..7703538ff7 100644
--- a/lib/chef/mixin/homebrew_user.rb
+++ b/lib/chef/mixin/homebrew_user.rb
@@ -23,7 +23,7 @@
# awkward to use modules elsewhere (e.g., chef/provider/package/homebrew/owner)
require_relative "shell_out"
-require "etc"
+require "etc" unless defined?(Etc)
class Chef
module Mixin
diff --git a/lib/chef/mixin/shell_out.rb b/lib/chef/mixin/shell_out.rb
index a7272c0bf3..f439323411 100644
--- a/lib/chef/mixin/shell_out.rb
+++ b/lib/chef/mixin/shell_out.rb
@@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "mixlib/shellout"
+require "mixlib/shellout" unless defined?(Mixlib::ShellOut)
require_relative "path_sanity"
class Chef
diff --git a/lib/chef/mixin/template.rb b/lib/chef/mixin/template.rb
index bb811aa758..e230044bae 100644
--- a/lib/chef/mixin/template.rb
+++ b/lib/chef/mixin/template.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require "tempfile"
-require "erubis"
+require "tempfile" unless defined?(Tempfile)
+require "erubis" unless defined?(Erubis)
class Chef
module Mixin
diff --git a/lib/chef/mixin/uris.rb b/lib/chef/mixin/uris.rb
index ea55eefd8f..53624ca41d 100644
--- a/lib/chef/mixin/uris.rb
+++ b/lib/chef/mixin/uris.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require "uri"
-require "addressable/uri"
+require "uri" unless defined?(URI)
+require "addressable/uri" unless defined?(Addressable::URI)
class Chef
module Mixin