diff options
-rw-r--r-- | .rubocop.yml | 2 | ||||
-rw-r--r-- | Rakefile | 2 | ||||
-rw-r--r-- | lib/mixlib/log/logging.rb | 2 | ||||
-rw-r--r-- | spec/mixlib/log_spec.rb | 24 |
4 files changed, 16 insertions, 14 deletions
diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..5b837e2 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,2 @@ +Style/HashSyntax: + Enabled: true @@ -10,7 +10,7 @@ end task default: [:style, :spec, :features] # For rubygems-test -task :test => :spec +task test: :spec RDoc::Task.new do |rdoc| rdoc.rdoc_dir = "rdoc" diff --git a/lib/mixlib/log/logging.rb b/lib/mixlib/log/logging.rb index 626237a..524900b 100644 --- a/lib/mixlib/log/logging.rb +++ b/lib/mixlib/log/logging.rb @@ -29,7 +29,7 @@ module Mixlib SEV_LABEL[sev + 1] || -"ANY" end - LEVELS = { :trace => TRACE, :debug => DEBUG, :info => INFO, :warn => WARN, :error => ERROR, :fatal => FATAL }.freeze + LEVELS = { trace: TRACE, debug: DEBUG, info: INFO, warn: WARN, error: ERROR, fatal: FATAL }.freeze LEVEL_NAMES = LEVELS.invert.freeze attr_accessor :metadata diff --git a/spec/mixlib/log_spec.rb b/spec/mixlib/log_spec.rb index 7285abc..5e0f270 100644 --- a/spec/mixlib/log_spec.rb +++ b/spec/mixlib/log_spec.rb @@ -97,12 +97,12 @@ RSpec.describe Mixlib::Log do it "should set the log level using the binding form, with :trace, :debug, :info, :warn, :error, or :fatal" do levels = { - :trace => Mixlib::Log::TRACE, - :debug => Mixlib::Log::DEBUG, - :info => Mixlib::Log::INFO, - :warn => Mixlib::Log::WARN, - :error => Mixlib::Log::ERROR, - :fatal => Mixlib::Log::FATAL, + trace: Mixlib::Log::TRACE, + debug: Mixlib::Log::DEBUG, + info: Mixlib::Log::INFO, + warn: Mixlib::Log::WARN, + error: Mixlib::Log::ERROR, + fatal: Mixlib::Log::FATAL, } levels.each do |symbol, constant| Logit.level = symbol @@ -120,12 +120,12 @@ RSpec.describe Mixlib::Log do it "should set the log level using the method form, with :trace, :debug, :info, :warn, :error, or :fatal" do levels = { - :trace => Mixlib::Log::TRACE, - :debug => Mixlib::Log::DEBUG, - :info => Mixlib::Log::INFO, - :warn => Mixlib::Log::WARN, - :error => Mixlib::Log::ERROR, - :fatal => Mixlib::Log::FATAL, + trace: Mixlib::Log::TRACE, + debug: Mixlib::Log::DEBUG, + info: Mixlib::Log::INFO, + warn: Mixlib::Log::WARN, + error: Mixlib::Log::ERROR, + fatal: Mixlib::Log::FATAL, } levels.each do |symbol, constant| Logit.level(symbol) |