summaryrefslogtreecommitdiff
path: root/lib/chef/knife/core
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/knife/core')
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb2
-rw-r--r--lib/chef/knife/core/gem_glob_loader.rb2
-rw-r--r--lib/chef/knife/core/generic_presenter.rb2
-rw-r--r--lib/chef/knife/core/object_loader.rb2
-rw-r--r--lib/chef/knife/core/ui.rb4
5 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index 759fb043c0..997ebd5f28 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -18,7 +18,7 @@
require_relative "../../run_list"
require_relative "../../util/path_helper"
-require "pathname"
+require "pathname" unless defined?(Pathname)
require_relative "../../dist"
class Chef
diff --git a/lib/chef/knife/core/gem_glob_loader.rb b/lib/chef/knife/core/gem_glob_loader.rb
index b5b9143552..41d85b83a4 100644
--- a/lib/chef/knife/core/gem_glob_loader.rb
+++ b/lib/chef/knife/core/gem_glob_loader.rb
@@ -39,7 +39,7 @@ class Chef
# subcommand loader has been modified to load the plugins by using Kernel.load
# with the absolute path.
def gem_and_builtin_subcommands
- require "rubygems"
+ require "rubygems" unless defined?(Gem)
find_subcommands_via_rubygems
rescue LoadError
find_subcommands_via_dirglob
diff --git a/lib/chef/knife/core/generic_presenter.rb b/lib/chef/knife/core/generic_presenter.rb
index 77c874e71a..96a4c766a5 100644
--- a/lib/chef/knife/core/generic_presenter.rb
+++ b/lib/chef/knife/core/generic_presenter.rb
@@ -89,7 +89,7 @@ class Chef
require "yaml"
YAML.dump(data)
when :pp
- require "stringio"
+ require "stringio" unless defined?(StringIO)
# If you were looking for some attribute and there is only one match
# just dump the attribute value
if config[:attribute] && data.length == 1
diff --git a/lib/chef/knife/core/object_loader.rb b/lib/chef/knife/core/object_loader.rb
index d87b3eaf71..94b956be04 100644
--- a/lib/chef/knife/core/object_loader.rb
+++ b/lib/chef/knife/core/object_loader.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require "ffi_yajl"
+require "ffi_yajl" unless defined?(FFI_Yajl)
require_relative "../../util/path_helper"
require_relative "../../data_bag_item"
diff --git a/lib/chef/knife/core/ui.rb b/lib/chef/knife/core/ui.rb
index cbda9c20f5..7961e1b523 100644
--- a/lib/chef/knife/core/ui.rb
+++ b/lib/chef/knife/core/ui.rb
@@ -18,10 +18,10 @@
# limitations under the License.
#
-require "forwardable"
+require "forwardable" unless defined?(Forwardable)
require_relative "../../platform/query_helpers"
require_relative "generic_presenter"
-require "tempfile"
+require "tempfile" unless defined?(Tempfile)
class Chef
class Knife