From fc39f1df4341ab39302814b81ed80c0d670cf1d8 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 26 Jun 2018 13:06:15 -0700 Subject: remove hashrocket syntax Signed-off-by: Lamont Granquist --- .rubocop.yml | 2 ++ Rakefile | 2 +- lib/mixlib/log/logging.rb | 2 +- spec/mixlib/log_spec.rb | 24 ++++++++++++------------ 4 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 .rubocop.yml 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 diff --git a/Rakefile b/Rakefile index 9b15524..f5fa61f 100644 --- a/Rakefile +++ b/Rakefile @@ -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) -- cgit v1.2.1