summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Rakefile2
-rw-r--r--lib/mixlib/log/formatter.rb2
-rw-r--r--spec/mixlib/log/child_spec.rb4
-rw-r--r--spec/mixlib/log/formatter_spec.rb2
-rw-r--r--spec/mixlib/log_spec.rb4
5 files changed, 7 insertions, 7 deletions
diff --git a/Rakefile b/Rakefile
index 5442c99..3939fd3 100644
--- a/Rakefile
+++ b/Rakefile
@@ -39,7 +39,7 @@ rescue LoadError
end
begin
- require "yard"
+ require "yard" unless defined?(YARD)
YARD::Rake::YardocTask.new(:docs)
rescue LoadError
puts "yard is not available. bundle install first to make sure all dependencies are installed."
diff --git a/lib/mixlib/log/formatter.rb b/lib/mixlib/log/formatter.rb
index 680836f..1febe90 100644
--- a/lib/mixlib/log/formatter.rb
+++ b/lib/mixlib/log/formatter.rb
@@ -16,7 +16,7 @@
# limitations under the License.
require "logger"
-require "time"
+require "time" unless defined?(Time)
module Mixlib
module Log
diff --git a/spec/mixlib/log/child_spec.rb b/spec/mixlib/log/child_spec.rb
index eef2ce9..182b86c 100644
--- a/spec/mixlib/log/child_spec.rb
+++ b/spec/mixlib/log/child_spec.rb
@@ -15,8 +15,8 @@
# limitations under the License.
#
-require "tempfile"
-require "stringio"
+require "tempfile" unless defined?(Tempfile)
+require "stringio" unless defined?(StringIO)
require "spec_helper"
RSpec.describe Mixlib::Log::Child do
diff --git a/spec/mixlib/log/formatter_spec.rb b/spec/mixlib/log/formatter_spec.rb
index 16e45af..491bb10 100644
--- a/spec/mixlib/log/formatter_spec.rb
+++ b/spec/mixlib/log/formatter_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require "time"
+require "time" unless defined?(Time)
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "spec_helper"))
RSpec.describe Mixlib::Log::Formatter do
diff --git a/spec/mixlib/log_spec.rb b/spec/mixlib/log_spec.rb
index 5366dcd..db638eb 100644
--- a/spec/mixlib/log_spec.rb
+++ b/spec/mixlib/log_spec.rb
@@ -17,8 +17,8 @@
# limitations under the License.
#
-require "tempfile"
-require "stringio"
+require "tempfile" unless defined?(Tempfile)
+require "stringio" unless defined?(StringIO)
require "spec_helper"
class LoggerLike