diff --git a/Gemfile b/Gemfile index a8fa97f..bda5e3f 100755 --- a/Gemfile +++ b/Gemfile @@ -5,4 +5,5 @@ gemspec group :development do gem "bundler" gem "rdoc" + gem "rubocop", "~> 0.49.1" end diff --git a/Rakefile b/Rakefile index 4507bdd..40c218b 100644 --- a/Rakefile +++ b/Rakefile @@ -7,7 +7,7 @@ RSpec::Core::RakeTask.new(:spec) do |spec| spec.pattern = "spec/**/*_spec.rb" end -task default: [:style, :spec, :features] +task default: %i[style spec features] # For rubygems-test task test: :spec diff --git a/lib/mixlib/log.rb b/lib/mixlib/log.rb index ccbeded..fc4a332 100644 --- a/lib/mixlib/log.rb +++ b/lib/mixlib/log.rb @@ -115,7 +115,7 @@ def level(new_level = nil) # Define the standard logger methods on this class programmatically. # No need to incur method_missing overhead on every log call. - [:debug, :info, :warn, :error, :fatal].each do |method_name| + %i[debug info warn error fatal].each do |method_name| class_eval(<<-METHOD_DEFN, __FILE__, __LINE__) def #{method_name}(msg=nil, &block) loggers.each {|l| l.#{method_name}(msg, &block) } @@ -127,7 +127,7 @@ def #{method_name}(msg=nil, &block) # Note that we *only* query the default logger (@logger) and not any other # loggers that may have been added, even though it is possible to configure # two (or more) loggers at different log levels. - [:debug?, :info?, :warn?, :error?, :fatal?].each do |method_name| + %i[debug? info? warn? error? fatal?].each do |method_name| class_eval(<<-METHOD_DEFN, __FILE__, __LINE__) def #{method_name} logger.#{method_name} diff --git a/spec/mixlib/log_spec.rb b/spec/mixlib/log_spec.rb index 8ff231a..1805da1 100644 --- a/spec/mixlib/log_spec.rb +++ b/spec/mixlib/log_spec.rb @@ -28,7 +28,7 @@ def initialize @messages = "" end - [:debug, :info, :warn, :error, :fatal].each do |method_name| + %i[debug info warn error fatal].each do |method_name| class_eval(<<-E) def #{method_name}(message) @messages << message