Skip to content

Commit

Permalink
Merge pull request #121 from roidrage/fix-rubocop-offenses
Browse files Browse the repository at this point in the history
Resolves outstanding rubocop offenses
  • Loading branch information
benlovell committed May 13, 2015
2 parents 0996b0b + f3689ab commit 5bae3f0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 23 deletions.
3 changes: 0 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@ AllCops:
Exclude:
- 'Guardfile'

Style/RegexpLiteral:
MaxSlashes: 2

Metrics/AbcSize:
Enabled: false
1 change: 1 addition & 0 deletions lib/lograge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
require 'active_support/core_ext/string/inflections'
require 'active_support/ordered_options'

# rubocop:disable ModuleLength
module Lograge
module_function

Expand Down
2 changes: 1 addition & 1 deletion spec/formatters/logstash_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
end

it "includes the 'path' key/value" do
expect(subject).to match(/"path":"\/"/)
expect(subject).to match(%r{"path":"/"})
end

it "includes the 'controller' key/value" do
Expand Down
2 changes: 1 addition & 1 deletion spec/lograge_logsubscriber_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@

it 'adds the location to the log line' do
subscriber.process_action(event)
expect(log_output.string).to match(/location=http:\/\/www.example.com/)
expect(log_output.string).to match(%r{location=http://www.example.com})
end

it 'removes the thread local variable' do
Expand Down
36 changes: 18 additions & 18 deletions spec/lograge_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
context 'when keep_original_rails_log is true' do
let(:app_config) do
double(config:
ActiveSupport::OrderedOptions.new.tap do |config|
config.action_dispatch = double(rack_cache: false)
config.lograge = ActiveSupport::OrderedOptions.new
config.lograge.keep_original_rails_log = true
end
)
ActiveSupport::OrderedOptions.new.tap do |config|
config.action_dispatch = double(rack_cache: false)
config.lograge = ActiveSupport::OrderedOptions.new
config.lograge.keep_original_rails_log = true
end
)
end

it "does not remove Rails' subscribers" do
Expand All @@ -62,12 +62,12 @@
subject { -> { Lograge.setup(app_config) } }
let(:app_config) do
double(config:
ActiveSupport::OrderedOptions.new.tap do |config|
config.action_dispatch = config_option
config.lograge = ActiveSupport::OrderedOptions.new
config.lograge.keep_original_rails_log = true
end
)
ActiveSupport::OrderedOptions.new.tap do |config|
config.action_dispatch = config_option
config.lograge = ActiveSupport::OrderedOptions.new
config.lograge.keep_original_rails_log = true
end
)
end
let(:config_option) { double(rack_cache: rack_cache) }

Expand Down Expand Up @@ -99,12 +99,12 @@
describe 'deprecated log_format interpreter' do
let(:app_config) do
double(config:
ActiveSupport::OrderedOptions.new.tap do |config|
config.action_dispatch = double(rack_cache: false)
config.lograge = ActiveSupport::OrderedOptions.new
config.lograge.log_format = format
end
)
ActiveSupport::OrderedOptions.new.tap do |config|
config.action_dispatch = double(rack_cache: false)
config.lograge = ActiveSupport::OrderedOptions.new
config.lograge.log_format = format
end
)
end
before { ActiveSupport::Deprecation.silence { Lograge.setup(app_config) } }
subject { Lograge.formatter }
Expand Down

0 comments on commit 5bae3f0

Please sign in to comment.