diff --git a/.rubocop.yml b/.rubocop.yml index 14b26e5..eea40b4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,7 +3,7 @@ inherit_mode: - Exclude AllCops: - TargetRubyVersion: 2.2 + TargetRubyVersion: 2.3 DisabledByDefault: true Exclude: - "examples/instrumentation.rb" diff --git a/.travis.yml b/.travis.yml index dd560bb..46bb12f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,6 @@ rvm: - 2.5.1 - 2.4.4 - 2.3.7 - - 2.2.10 - jruby-9.1.16.0 before_install: diff --git a/Appraisals b/Appraisals index 00b4bca..2cabba7 100644 --- a/Appraisals +++ b/Appraisals @@ -1,3 +1,5 @@ +# frozen_string_literal: true + appraise "rack_2_0" do gem "rack", "~> 2.0.4" end diff --git a/Gemfile b/Gemfile index fa75df1..7f4f5e9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source 'https://rubygems.org' gemspec diff --git a/Rakefile b/Rakefile index 182e118..f08b537 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubygems" require "bundler/setup" require 'bundler/gem_tasks' diff --git a/examples/rack_attack.rb b/examples/rack_attack.rb index eea07c0..43f1348 100644 --- a/examples/rack_attack.rb +++ b/examples/rack_attack.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # NB: `req` is a Rack::Request object (basically an env hash with friendly accessor methods) # Throttle 10 requests/ip/second diff --git a/gemfiles/active_support_redis_cache_store.gemfile b/gemfiles/active_support_redis_cache_store.gemfile index 30e1e38..040271b 100644 --- a/gemfiles/active_support_redis_cache_store.gemfile +++ b/gemfiles/active_support_redis_cache_store.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/gemfiles/active_support_redis_cache_store_pooled.gemfile b/gemfiles/active_support_redis_cache_store_pooled.gemfile index 9232a9b..357ca42 100644 --- a/gemfiles/active_support_redis_cache_store_pooled.gemfile +++ b/gemfiles/active_support_redis_cache_store_pooled.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/gemfiles/active_support_redis_store.gemfile b/gemfiles/active_support_redis_store.gemfile index 517c70f..922f3cc 100644 --- a/gemfiles/active_support_redis_store.gemfile +++ b/gemfiles/active_support_redis_store.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/gemfiles/connection_pool_dalli.gemfile b/gemfiles/connection_pool_dalli.gemfile index 69dc887..8c62b05 100644 --- a/gemfiles/connection_pool_dalli.gemfile +++ b/gemfiles/connection_pool_dalli.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/gemfiles/dalli2.gemfile b/gemfiles/dalli2.gemfile index c47d5af..1628ad6 100644 --- a/gemfiles/dalli2.gemfile +++ b/gemfiles/dalli2.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/gemfiles/rack_1_6.gemfile b/gemfiles/rack_1_6.gemfile index 0cc0050..91789b4 100644 --- a/gemfiles/rack_1_6.gemfile +++ b/gemfiles/rack_1_6.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/gemfiles/rack_2_0.gemfile b/gemfiles/rack_2_0.gemfile index 9915a10..c7866b6 100644 --- a/gemfiles/rack_2_0.gemfile +++ b/gemfiles/rack_2_0.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/gemfiles/rails_4_2.gemfile b/gemfiles/rails_4_2.gemfile index eb09083..5e7dfe3 100644 --- a/gemfiles/rails_4_2.gemfile +++ b/gemfiles/rails_4_2.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/gemfiles/rails_5_1.gemfile b/gemfiles/rails_5_1.gemfile index d05d8e4..bac5d16 100644 --- a/gemfiles/rails_5_1.gemfile +++ b/gemfiles/rails_5_1.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/gemfiles/rails_5_2.gemfile b/gemfiles/rails_5_2.gemfile index d12b8c6..1873512 100644 --- a/gemfiles/rails_5_2.gemfile +++ b/gemfiles/rails_5_2.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/gemfiles/redis_store.gemfile b/gemfiles/redis_store.gemfile index 8aafc6d..0ba921a 100644 --- a/gemfiles/redis_store.gemfile +++ b/gemfiles/redis_store.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/lib/rack/attack.rb b/lib/rack/attack.rb index 66638a4..f8cd308 100644 --- a/lib/rack/attack.rb +++ b/lib/rack/attack.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack' require 'forwardable' require 'rack/attack/path_normalizer' diff --git a/lib/rack/attack/allow2ban.rb b/lib/rack/attack/allow2ban.rb index 9a91086..faa3518 100644 --- a/lib/rack/attack/allow2ban.rb +++ b/lib/rack/attack/allow2ban.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class Attack class Allow2Ban < Fail2Ban diff --git a/lib/rack/attack/blocklist.rb b/lib/rack/attack/blocklist.rb index 3cfba54..ee57656 100644 --- a/lib/rack/attack/blocklist.rb +++ b/lib/rack/attack/blocklist.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class Attack class Blocklist < Check diff --git a/lib/rack/attack/cache.rb b/lib/rack/attack/cache.rb index 0e6e6d3..37d9173 100644 --- a/lib/rack/attack/cache.rb +++ b/lib/rack/attack/cache.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class Attack class Cache diff --git a/lib/rack/attack/check.rb b/lib/rack/attack/check.rb index b24a873..2e5c64d 100644 --- a/lib/rack/attack/check.rb +++ b/lib/rack/attack/check.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class Attack class Check diff --git a/lib/rack/attack/fail2ban.rb b/lib/rack/attack/fail2ban.rb index 413808e..b43c7cb 100644 --- a/lib/rack/attack/fail2ban.rb +++ b/lib/rack/attack/fail2ban.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class Attack class Fail2Ban diff --git a/lib/rack/attack/path_normalizer.rb b/lib/rack/attack/path_normalizer.rb index fd5935f..635f9f2 100644 --- a/lib/rack/attack/path_normalizer.rb +++ b/lib/rack/attack/path_normalizer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Rack::Attack # When using Rack::Attack with a Rails app, developers expect the request path # to be normalized. In particular, trailing slashes are stripped. diff --git a/lib/rack/attack/request.rb b/lib/rack/attack/request.rb index ee05f89..1cac479 100644 --- a/lib/rack/attack/request.rb +++ b/lib/rack/attack/request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Rack::Attack::Request is the same as ::Rack::Request by default. # # This is a safe place to add custom helper methods to the request object diff --git a/lib/rack/attack/safelist.rb b/lib/rack/attack/safelist.rb index e548b0b..d335be2 100644 --- a/lib/rack/attack/safelist.rb +++ b/lib/rack/attack/safelist.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class Attack class Safelist < Check diff --git a/lib/rack/attack/store_proxy.rb b/lib/rack/attack/store_proxy.rb index 62a7e68..c9bde97 100644 --- a/lib/rack/attack/store_proxy.rb +++ b/lib/rack/attack/store_proxy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class Attack module StoreProxy diff --git a/lib/rack/attack/store_proxy/dalli_proxy.rb b/lib/rack/attack/store_proxy/dalli_proxy.rb index ccaa8bf..f3fbc6c 100644 --- a/lib/rack/attack/store_proxy/dalli_proxy.rb +++ b/lib/rack/attack/store_proxy/dalli_proxy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'delegate' module Rack diff --git a/lib/rack/attack/store_proxy/mem_cache_proxy.rb b/lib/rack/attack/store_proxy/mem_cache_proxy.rb index 4675789..8ed6583 100644 --- a/lib/rack/attack/store_proxy/mem_cache_proxy.rb +++ b/lib/rack/attack/store_proxy/mem_cache_proxy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class Attack module StoreProxy 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 d6cbdfb..c7feaa7 100644 --- a/lib/rack/attack/store_proxy/redis_cache_store_proxy.rb +++ b/lib/rack/attack/store_proxy/redis_cache_store_proxy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'delegate' module Rack diff --git a/lib/rack/attack/store_proxy/redis_store_proxy.rb b/lib/rack/attack/store_proxy/redis_store_proxy.rb index f9f2c5b..44d6625 100644 --- a/lib/rack/attack/store_proxy/redis_store_proxy.rb +++ b/lib/rack/attack/store_proxy/redis_store_proxy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'delegate' module Rack diff --git a/lib/rack/attack/throttle.rb b/lib/rack/attack/throttle.rb index b89e114..c2e6cb3 100644 --- a/lib/rack/attack/throttle.rb +++ b/lib/rack/attack/throttle.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class Attack class Throttle diff --git a/lib/rack/attack/track.rb b/lib/rack/attack/track.rb index 123bfa4..dba16ca 100644 --- a/lib/rack/attack/track.rb +++ b/lib/rack/attack/track.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class Attack class Track diff --git a/lib/rack/attack/version.rb b/lib/rack/attack/version.rb index e4ec2ea..07a1d57 100644 --- a/lib/rack/attack/version.rb +++ b/lib/rack/attack/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class Attack VERSION = '5.3.2' diff --git a/rack-attack.gemspec b/rack-attack.gemspec index dd5e628..e5828f4 100644 --- a/rack-attack.gemspec +++ b/rack-attack.gemspec @@ -1,4 +1,5 @@ # -*- encoding: utf-8 -*- +# frozen_string_literal: true lib = File.expand_path('../lib/', __FILE__) $:.unshift lib unless $:.include?(lib) @@ -27,7 +28,7 @@ Gem::Specification.new do |s| "source_code_uri" => "https://github.com/kickstarter/rack-attack" } - s.required_ruby_version = '>= 2.2' + s.required_ruby_version = '>= 2.3' s.add_runtime_dependency 'rack', ">= 1.0", "< 3" diff --git a/spec/acceptance/allow2ban_spec.rb b/spec/acceptance/allow2ban_spec.rb index 5495c05..6de18d0 100644 --- a/spec/acceptance/allow2ban_spec.rb +++ b/spec/acceptance/allow2ban_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" require "timecop" diff --git a/spec/acceptance/blocking_ip_spec.rb b/spec/acceptance/blocking_ip_spec.rb index 85dde63..cfb2282 100644 --- a/spec/acceptance/blocking_ip_spec.rb +++ b/spec/acceptance/blocking_ip_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "Blocking an IP" do diff --git a/spec/acceptance/blocking_spec.rb b/spec/acceptance/blocking_spec.rb index 83b5202..db176c8 100644 --- a/spec/acceptance/blocking_spec.rb +++ b/spec/acceptance/blocking_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "#blocklist" do diff --git a/spec/acceptance/blocking_subnet_spec.rb b/spec/acceptance/blocking_subnet_spec.rb index 7143445..1f417d7 100644 --- a/spec/acceptance/blocking_subnet_spec.rb +++ b/spec/acceptance/blocking_subnet_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "Blocking an IP subnet" do diff --git a/spec/acceptance/cache_store_config_for_allow2ban_spec.rb b/spec/acceptance/cache_store_config_for_allow2ban_spec.rb index 4b6cb11..09fdab8 100644 --- a/spec/acceptance/cache_store_config_for_allow2ban_spec.rb +++ b/spec/acceptance/cache_store_config_for_allow2ban_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "Cache store config when using allow2ban" do diff --git a/spec/acceptance/cache_store_config_for_fail2ban_spec.rb b/spec/acceptance/cache_store_config_for_fail2ban_spec.rb index 4f978a1..8052fc1 100644 --- a/spec/acceptance/cache_store_config_for_fail2ban_spec.rb +++ b/spec/acceptance/cache_store_config_for_fail2ban_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "Cache store config when using fail2ban" do diff --git a/spec/acceptance/cache_store_config_for_throttle_spec.rb b/spec/acceptance/cache_store_config_for_throttle_spec.rb index 524048b..9be6e59 100644 --- a/spec/acceptance/cache_store_config_for_throttle_spec.rb +++ b/spec/acceptance/cache_store_config_for_throttle_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "Cache store config when throttling without Rails" do diff --git a/spec/acceptance/cache_store_config_with_rails_spec.rb b/spec/acceptance/cache_store_config_with_rails_spec.rb index bd87828..3d9ac22 100644 --- a/spec/acceptance/cache_store_config_with_rails_spec.rb +++ b/spec/acceptance/cache_store_config_with_rails_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" require "minitest/stub_const" require "ostruct" diff --git a/spec/acceptance/customizing_blocked_response_spec.rb b/spec/acceptance/customizing_blocked_response_spec.rb index cf297b0..fd830c2 100644 --- a/spec/acceptance/customizing_blocked_response_spec.rb +++ b/spec/acceptance/customizing_blocked_response_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "Customizing block responses" do diff --git a/spec/acceptance/customizing_throttled_response_spec.rb b/spec/acceptance/customizing_throttled_response_spec.rb index 61acc01..5c84979 100644 --- a/spec/acceptance/customizing_throttled_response_spec.rb +++ b/spec/acceptance/customizing_throttled_response_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "Customizing throttled response" do diff --git a/spec/acceptance/extending_request_object_spec.rb b/spec/acceptance/extending_request_object_spec.rb index f6e0d0f..a4ea1a6 100644 --- a/spec/acceptance/extending_request_object_spec.rb +++ b/spec/acceptance/extending_request_object_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "Extending the request object" do diff --git a/spec/acceptance/fail2ban_spec.rb b/spec/acceptance/fail2ban_spec.rb index 7fac437..fde67f9 100644 --- a/spec/acceptance/fail2ban_spec.rb +++ b/spec/acceptance/fail2ban_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" require "timecop" diff --git a/spec/acceptance/safelisting_ip_spec.rb b/spec/acceptance/safelisting_ip_spec.rb index c0c8203..bdf7d67 100644 --- a/spec/acceptance/safelisting_ip_spec.rb +++ b/spec/acceptance/safelisting_ip_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "Safelist an IP" do diff --git a/spec/acceptance/safelisting_spec.rb b/spec/acceptance/safelisting_spec.rb index 420fc9a..dc4d82d 100644 --- a/spec/acceptance/safelisting_spec.rb +++ b/spec/acceptance/safelisting_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "#safelist" do diff --git a/spec/acceptance/safelisting_subnet_spec.rb b/spec/acceptance/safelisting_subnet_spec.rb index 22c60f5..50d99f6 100644 --- a/spec/acceptance/safelisting_subnet_spec.rb +++ b/spec/acceptance/safelisting_subnet_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "Safelisting an IP subnet" do diff --git a/spec/acceptance/stores/active_support_dalli_store_spec.rb b/spec/acceptance/stores/active_support_dalli_store_spec.rb index 440a860..45ecf3d 100644 --- a/spec/acceptance/stores/active_support_dalli_store_spec.rb +++ b/spec/acceptance/stores/active_support_dalli_store_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../../spec_helper" if defined?(::Dalli) diff --git a/spec/acceptance/stores/active_support_mem_cache_store_spec.rb b/spec/acceptance/stores/active_support_mem_cache_store_spec.rb index 4a3ced6..86de47c 100644 --- a/spec/acceptance/stores/active_support_mem_cache_store_spec.rb +++ b/spec/acceptance/stores/active_support_mem_cache_store_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../../spec_helper" if defined?(::Dalli) diff --git a/spec/acceptance/stores/active_support_memory_store_spec.rb b/spec/acceptance/stores/active_support_memory_store_spec.rb index 94de429..8657aa2 100644 --- a/spec/acceptance/stores/active_support_memory_store_spec.rb +++ b/spec/acceptance/stores/active_support_memory_store_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../../spec_helper" require_relative "../../support/cache_store_helper" diff --git a/spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb b/spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb index 5295ba5..13da998 100644 --- a/spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb +++ b/spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../../spec_helper" if defined?(::ConnectionPool) && defined?(::Redis) && defined?(::ActiveSupport::Cache::RedisCacheStore) diff --git a/spec/acceptance/stores/active_support_redis_cache_store_spec.rb b/spec/acceptance/stores/active_support_redis_cache_store_spec.rb index e6ecdda..4303a3f 100644 --- a/spec/acceptance/stores/active_support_redis_cache_store_spec.rb +++ b/spec/acceptance/stores/active_support_redis_cache_store_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../../spec_helper" if defined?(::Redis) && defined?(::ActiveSupport::Cache::RedisCacheStore) diff --git a/spec/acceptance/stores/active_support_redis_store_spec.rb b/spec/acceptance/stores/active_support_redis_store_spec.rb index 840a7d4..9aa7d08 100644 --- a/spec/acceptance/stores/active_support_redis_store_spec.rb +++ b/spec/acceptance/stores/active_support_redis_store_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../../spec_helper" if defined?(::ActiveSupport::Cache::RedisStore) diff --git a/spec/acceptance/stores/connection_pool_dalli_client_spec.rb b/spec/acceptance/stores/connection_pool_dalli_client_spec.rb index 15f4564..1ccf5d2 100644 --- a/spec/acceptance/stores/connection_pool_dalli_client_spec.rb +++ b/spec/acceptance/stores/connection_pool_dalli_client_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../../spec_helper" if defined?(::Dalli) && defined?(::ConnectionPool) diff --git a/spec/acceptance/stores/dalli_client_spec.rb b/spec/acceptance/stores/dalli_client_spec.rb index 48a2d9f..dedd9ab 100644 --- a/spec/acceptance/stores/dalli_client_spec.rb +++ b/spec/acceptance/stores/dalli_client_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../../spec_helper" if defined?(::Dalli) diff --git a/spec/acceptance/stores/redis_store_spec.rb b/spec/acceptance/stores/redis_store_spec.rb index 9c9fba5..82898e6 100644 --- a/spec/acceptance/stores/redis_store_spec.rb +++ b/spec/acceptance/stores/redis_store_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../../spec_helper" require_relative "../../support/cache_store_helper" diff --git a/spec/acceptance/throttling_spec.rb b/spec/acceptance/throttling_spec.rb index 947e4ed..719def8 100644 --- a/spec/acceptance/throttling_spec.rb +++ b/spec/acceptance/throttling_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" require "timecop" diff --git a/spec/acceptance/track_spec.rb b/spec/acceptance/track_spec.rb index 928cc31..5f72db8 100644 --- a/spec/acceptance/track_spec.rb +++ b/spec/acceptance/track_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" describe "#track" do diff --git a/spec/acceptance/track_throttle_spec.rb b/spec/acceptance/track_throttle_spec.rb index f3f8a80..1d2c5ab 100644 --- a/spec/acceptance/track_throttle_spec.rb +++ b/spec/acceptance/track_throttle_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../spec_helper" require "timecop" diff --git a/spec/allow2ban_spec.rb b/spec/allow2ban_spec.rb index 93564d2..074a231 100644 --- a/spec/allow2ban_spec.rb +++ b/spec/allow2ban_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'spec_helper' describe 'Rack::Attack.Allow2Ban' do diff --git a/spec/fail2ban_spec.rb b/spec/fail2ban_spec.rb index e1fe7ef..91242f7 100644 --- a/spec/fail2ban_spec.rb +++ b/spec/fail2ban_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'spec_helper' describe 'Rack::Attack.Fail2Ban' do diff --git a/spec/integration/offline_spec.rb b/spec/integration/offline_spec.rb index 6a6e925..1f2cbfa 100644 --- a/spec/integration/offline_spec.rb +++ b/spec/integration/offline_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'active_support/cache' require_relative '../spec_helper' diff --git a/spec/rack_attack_dalli_proxy_spec.rb b/spec/rack_attack_dalli_proxy_spec.rb index 9065354..7eb23f0 100644 --- a/spec/rack_attack_dalli_proxy_spec.rb +++ b/spec/rack_attack_dalli_proxy_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'spec_helper' describe Rack::Attack::StoreProxy::DalliProxy do diff --git a/spec/rack_attack_instrumentation_spec.rb b/spec/rack_attack_instrumentation_spec.rb index 88883d0..1bd51a3 100644 --- a/spec/rack_attack_instrumentation_spec.rb +++ b/spec/rack_attack_instrumentation_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # ActiveSupport::Subscribers added in ~> 4.0.2.0 if ActiveSupport::VERSION::MAJOR > 3 require_relative 'spec_helper' diff --git a/spec/rack_attack_path_normalizer_spec.rb b/spec/rack_attack_path_normalizer_spec.rb index 1c5b66e..961491d 100644 --- a/spec/rack_attack_path_normalizer_spec.rb +++ b/spec/rack_attack_path_normalizer_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'spec_helper' describe Rack::Attack::PathNormalizer do diff --git a/spec/rack_attack_request_spec.rb b/spec/rack_attack_request_spec.rb index 41dfd82..8d4d27f 100644 --- a/spec/rack_attack_request_spec.rb +++ b/spec/rack_attack_request_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'spec_helper' describe 'Rack::Attack' do diff --git a/spec/rack_attack_spec.rb b/spec/rack_attack_spec.rb index 3869b71..da5aa2e 100644 --- a/spec/rack_attack_spec.rb +++ b/spec/rack_attack_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'spec_helper' describe 'Rack::Attack' do diff --git a/spec/rack_attack_throttle_spec.rb b/spec/rack_attack_throttle_spec.rb index b32891a..2735b7a 100644 --- a/spec/rack_attack_throttle_spec.rb +++ b/spec/rack_attack_throttle_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'spec_helper' describe 'Rack::Attack.throttle' do diff --git a/spec/rack_attack_track_spec.rb b/spec/rack_attack_track_spec.rb index 352561d..39c6ab9 100644 --- a/spec/rack_attack_track_spec.rb +++ b/spec/rack_attack_track_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'spec_helper' describe 'Rack::Attack.track' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 20c6d47..72b2797 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubygems" require "bundler/setup" diff --git a/spec/support/cache_store_helper.rb b/spec/support/cache_store_helper.rb index 2ca7606..7655949 100644 --- a/spec/support/cache_store_helper.rb +++ b/spec/support/cache_store_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Minitest::Spec def self.it_works_for_cache_backed_features it "works for throttle" do