summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/cookbook')
-rw-r--r--lib/chef/cookbook/gem_installer.rb2
-rw-r--r--lib/chef/cookbook/synchronizer.rb2
-rw-r--r--lib/chef/cookbook/syntax_check.rb6
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/cookbook/gem_installer.rb b/lib/chef/cookbook/gem_installer.rb
index 830dce757a..bd1d0fb93a 100644
--- a/lib/chef/cookbook/gem_installer.rb
+++ b/lib/chef/cookbook/gem_installer.rb
@@ -14,7 +14,7 @@
# limitations under the License.
#
-require "tmpdir"
+require "tmpdir" unless defined?(Dir.mktmpdir)
require_relative "../mixin/shell_out"
class Chef
diff --git a/lib/chef/cookbook/synchronizer.rb b/lib/chef/cookbook/synchronizer.rb
index b1fa1b436d..8c87ababb6 100644
--- a/lib/chef/cookbook/synchronizer.rb
+++ b/lib/chef/cookbook/synchronizer.rb
@@ -16,7 +16,7 @@
require_relative "../client"
require_relative "../util/threaded_job_queue"
require_relative "../server_api"
-require "singleton"
+require "singleton" unless defined?(Singleton)
require_relative "../dist"
class Chef
diff --git a/lib/chef/cookbook/syntax_check.rb b/lib/chef/cookbook/syntax_check.rb
index 8743e07caf..89061d4f5f 100644
--- a/lib/chef/cookbook/syntax_check.rb
+++ b/lib/chef/cookbook/syntax_check.rb
@@ -15,9 +15,9 @@
# limitations under the License.
#
-require "pathname"
-require "stringio"
-require "erubis"
+require "pathname" unless defined?(Pathname)
+require "stringio" unless defined?(StringIO)
+require "erubis" unless defined?(Erubis)
require_relative "../mixin/shell_out"
require_relative "../mixin/checksum"
require_relative "../util/path_helper"