summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-08-21 11:35:54 -0700
committerTim Smith <tsmith84@gmail.com>2020-08-21 11:35:54 -0700
commita5c7bb6f3ac6b423c48bbfc71aa8df709b80253c (patch)
tree1542e681d887d2cb1b2ad3c193fed98d6280d9a5
parente825ec79ae03f5877d9a2dcbf72ab92c28cf6d76 (diff)
downloadmixlib-log-a5c7bb6f3ac6b423c48bbfc71aa8df709b80253c.tar.gz
Update how we determine if time was loadedrequires
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/mixlib/log/formatter.rb2
-rw-r--r--spec/mixlib/log/formatter_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/mixlib/log/formatter.rb b/lib/mixlib/log/formatter.rb
index 1febe90..9041ff6 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" unless defined?(Time)
+require "time" unless defined?(Time.zone_offset)
module Mixlib
module Log
diff --git a/spec/mixlib/log/formatter_spec.rb b/spec/mixlib/log/formatter_spec.rb
index 491bb10..ee7de09 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" unless defined?(Time)
+require "time" unless defined?(Time.zone_offset)
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "spec_helper"))
RSpec.describe Mixlib::Log::Formatter do