From 34ee066eace4d0815697779578daa1e335fc3031 Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Tue, 23 Jan 2018 16:12:16 -0300 Subject: [PATCH] Drop support for Rails 3 --- README.md | 2 +- lib/rack/attack/path_normalizer.rb | 5 +---- spec/spec_helper.rb | 3 --- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index bd5f7d2..66e2d6e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Install the [rack-attack](http://rubygems.org/gems/rack-attack) gem; or add it t gem 'rack-attack' ``` Tell your app to use the Rack::Attack middleware. -For Rails 3+ apps: +For Rails apps: ```ruby # In config/application.rb diff --git a/lib/rack/attack/path_normalizer.rb b/lib/rack/attack/path_normalizer.rb index afeb2f9..4b4171e 100644 --- a/lib/rack/attack/path_normalizer.rb +++ b/lib/rack/attack/path_normalizer.rb @@ -15,11 +15,8 @@ class Rack::Attack end PathNormalizer = if defined?(::ActionDispatch::Journey::Router::Utils) - # For Rails 4+ apps + # For Rails apps ::ActionDispatch::Journey::Router::Utils - elsif defined?(::Journey::Router::Utils) - # for Rails 3.2 - ::Journey::Router::Utils else FallbackPathNormalizer end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 118d1fe..b7d535f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,9 +7,6 @@ require "rack/test" require 'active_support' require 'action_dispatch' -# Load Journey for Rails 3.2 -require 'journey' if ActionPack::VERSION::MAJOR == 3 - require "rack/attack" begin