mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +00:00
ci: update tested rails versions (#626)
This commit is contained in:
parent
c7098d610b
commit
36b830ab3c
4 changed files with 25 additions and 59 deletions
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
|
|
@ -32,7 +32,6 @@ jobs:
|
||||||
- rails_6_1
|
- rails_6_1
|
||||||
- rails_6_0
|
- rails_6_0
|
||||||
- rails_5_2
|
- rails_5_2
|
||||||
- rails_4_2
|
|
||||||
- dalli3
|
- dalli3
|
||||||
- dalli2
|
- dalli2
|
||||||
- redis_5
|
- redis_5
|
||||||
|
|
@ -56,8 +55,6 @@ jobs:
|
||||||
ruby: 3.2.2
|
ruby: 3.2.2
|
||||||
- gemfile: active_support_5_redis_cache_store_pooled
|
- gemfile: active_support_5_redis_cache_store_pooled
|
||||||
ruby: 3.2.2
|
ruby: 3.2.2
|
||||||
- gemfile: rails_4_2
|
|
||||||
ruby: 3.2.2
|
|
||||||
- gemfile: dalli2
|
- gemfile: dalli2
|
||||||
ruby: 3.2.2
|
ruby: 3.2.2
|
||||||
- gemfile: rack_1
|
- gemfile: rack_1
|
||||||
|
|
@ -68,8 +65,6 @@ jobs:
|
||||||
ruby: 3.1.4
|
ruby: 3.1.4
|
||||||
- gemfile: active_support_5_redis_cache_store_pooled
|
- gemfile: active_support_5_redis_cache_store_pooled
|
||||||
ruby: 3.1.4
|
ruby: 3.1.4
|
||||||
- gemfile: rails_4_2
|
|
||||||
ruby: 3.1.4
|
|
||||||
- gemfile: dalli2
|
- gemfile: dalli2
|
||||||
ruby: 3.1.4
|
ruby: 3.1.4
|
||||||
- gemfile: rack_1
|
- gemfile: rack_1
|
||||||
|
|
@ -80,14 +75,10 @@ jobs:
|
||||||
ruby: 3.0.6
|
ruby: 3.0.6
|
||||||
- gemfile: active_support_5_redis_cache_store_pooled
|
- gemfile: active_support_5_redis_cache_store_pooled
|
||||||
ruby: 3.0.6
|
ruby: 3.0.6
|
||||||
- gemfile: rails_4_2
|
|
||||||
ruby: 3.0.6
|
|
||||||
- gemfile: dalli2
|
- gemfile: dalli2
|
||||||
ruby: 3.0.6
|
ruby: 3.0.6
|
||||||
- gemfile: rack_1
|
- gemfile: rack_1
|
||||||
ruby: 2.7.8
|
ruby: 2.7.8
|
||||||
- gemfile: rails_4_2
|
|
||||||
ruby: 2.7.8
|
|
||||||
- gemfile: rails_7_0
|
- gemfile: rails_7_0
|
||||||
ruby: 2.6.10
|
ruby: 2.6.10
|
||||||
- gemfile: rails_7_0
|
- gemfile: rails_7_0
|
||||||
|
|
|
||||||
|
|
@ -41,14 +41,6 @@ appraise 'rails_5-2' do
|
||||||
gem 'railties', '~> 5.2.0'
|
gem 'railties', '~> 5.2.0'
|
||||||
end
|
end
|
||||||
|
|
||||||
appraise 'rails_4-2' do
|
|
||||||
gem 'railties', '~> 4.2.0'
|
|
||||||
|
|
||||||
# Override rack-test version constraint by making it more loose
|
|
||||||
# so it's compatible with actionpack 4.2.x
|
|
||||||
gem "rack-test", ">= 0.6"
|
|
||||||
end
|
|
||||||
|
|
||||||
appraise 'dalli2' do
|
appraise 'dalli2' do
|
||||||
gem 'dalli', '~> 2.0'
|
gem 'dalli', '~> 2.0'
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
# This file was generated by Appraisal
|
|
||||||
|
|
||||||
source "https://rubygems.org"
|
|
||||||
|
|
||||||
gem "railties", "~> 4.2.0"
|
|
||||||
gem "rack-test", ">= 0.6"
|
|
||||||
|
|
||||||
group :maintenance, optional: true do
|
|
||||||
gem "bake"
|
|
||||||
gem "bake-gem"
|
|
||||||
end
|
|
||||||
|
|
||||||
gemspec path: "../"
|
|
||||||
|
|
@ -2,12 +2,9 @@
|
||||||
|
|
||||||
require_relative "spec_helper"
|
require_relative "spec_helper"
|
||||||
require 'active_support'
|
require 'active_support'
|
||||||
|
require 'active_support/subscriber'
|
||||||
|
|
||||||
# ActiveSupport::Subscribers added in ~> 4.0.2.0
|
class CustomSubscriber < ActiveSupport::Subscriber
|
||||||
if ActiveSupport::VERSION::MAJOR > 3
|
|
||||||
require_relative 'spec_helper'
|
|
||||||
require 'active_support/subscriber'
|
|
||||||
class CustomSubscriber < ActiveSupport::Subscriber
|
|
||||||
@notification_count = 0
|
@notification_count = 0
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
|
@ -17,9 +14,9 @@ if ActiveSupport::VERSION::MAJOR > 3
|
||||||
def throttle(_event)
|
def throttle(_event)
|
||||||
self.class.notification_count += 1
|
self.class.notification_count += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'Rack::Attack.instrument' do
|
describe 'Rack::Attack.instrument' do
|
||||||
before do
|
before do
|
||||||
@period = 60 # Use a long period; failures due to cache key rotation less likely
|
@period = 60 # Use a long period; failures due to cache key rotation less likely
|
||||||
Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new
|
Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new
|
||||||
|
|
@ -39,5 +36,4 @@ if ActiveSupport::VERSION::MAJOR > 3
|
||||||
assert_equal 1, CustomSubscriber.notification_count
|
assert_equal 1, CustomSubscriber.notification_count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue