From 86eb9f9e0a6ed4a265a16946f56a7f452fc7c9f5 Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Tue, 19 Jun 2018 17:55:24 -0300 Subject: [PATCH] Enable Style/BracesAroundHashParameters rubocop cop --- .rubocop.yml | 3 +++ lib/rack/attack/store_proxy/redis_cache_store_proxy.rb | 4 ++-- spec/rack_attack_throttle_spec.rb | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 5ca4365..1d679e3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -30,6 +30,9 @@ Security: Lint: Enabled: true +Style/BracesAroundHashParameters: + Enabled: true + Style/FrozenStringLiteralComment: Enabled: true diff --git a/lib/rack/attack/store_proxy/redis_cache_store_proxy.rb b/lib/rack/attack/store_proxy/redis_cache_store_proxy.rb index 319445e..8bb3f46 100644 --- a/lib/rack/attack/store_proxy/redis_cache_store_proxy.rb +++ b/lib/rack/attack/store_proxy/redis_cache_store_proxy.rb @@ -18,11 +18,11 @@ module Rack end def read(name, options = {}) - super(name, options.merge!({ raw: true })) + super(name, options.merge!(raw: true)) end def write(name, value, options = {}) - super(name, value, options.merge!({ raw: true })) + super(name, value, options.merge!(raw: true)) end end end diff --git a/spec/rack_attack_throttle_spec.rb b/spec/rack_attack_throttle_spec.rb index 0361c7c..b32891a 100644 --- a/spec/rack_attack_throttle_spec.rb +++ b/spec/rack_attack_throttle_spec.rb @@ -37,7 +37,7 @@ describe 'Rack::Attack.throttle' do it 'should tag the env' do last_request.env['rack.attack.matched'].must_equal 'ip/sec' last_request.env['rack.attack.match_type'].must_equal :throttle - last_request.env['rack.attack.match_data'].must_equal({ :count => 2, :limit => 1, :period => @period }) + last_request.env['rack.attack.match_data'].must_equal(:count => 2, :limit => 1, :period => @period) last_request.env['rack.attack.match_discriminator'].must_equal('1.2.3.4') end