Skip to content

Commit

Permalink
Merge pull request #36 from catawiki/activesupport-7.1-compatibility
Browse files Browse the repository at this point in the history
Activesupport 7.1 compatibility
  • Loading branch information
ArisBee authored May 17, 2024
2 parents 9004575 + b2c1370 commit fcf685b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['2.7', '3.0', '3.1']
ruby: ['2.7', '3.0', '3.1', '3.2']
steps:
- uses: actions/checkout@v3

Expand All @@ -29,7 +29,7 @@ jobs:
- name: Run Rspec
run: bundle exec rspec

- if: ${{ matrix.ruby == '3.1' }}
- if: ${{ matrix.ruby == '3.2' }}
name: Upload coverage results
uses: actions/upload-artifact@v3
with:
Expand Down
14 changes: 14 additions & 0 deletions .rubocop/ruby-3.2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
inherit_from:
- base.yml

AllCops:
TargetRubyVersion: 3.2

Gemspec/RequiredRubyVersion:
Enabled: false

Naming/BlockForwarding:
Enabled: false

Style/HashSyntax:
Enabled: false
4 changes: 3 additions & 1 deletion lib/rate_limit.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

require 'active_support/core_ext/module'
require 'active_support'
require 'active_support/core_ext'

require_relative 'rate_limit/configurable'
require_relative 'rate_limit/result'
require_relative 'rate_limit/cache'
Expand Down
3 changes: 1 addition & 2 deletions lib/rate_limit/config/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ module Defaults
class << self
def raw_limits
{
RateLimit.config.default_threshold => \
RateLimit.config.default_interval
RateLimit.config.default_threshold => RateLimit.config.default_interval
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rate_limit/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module RateLimit
VERSION = '0.2.1'
VERSION = '0.3.0'
end
2 changes: 1 addition & 1 deletion rate_limit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_dependency 'activesupport', '>= 5.2', '<= 7.0.4'
spec.add_dependency 'activesupport', '>= 5.2', '< 7.2'
spec.add_dependency 'redis', '>= 3.0.0', '<= 5.1.0'
spec.metadata['rubygems_mfa_required'] = 'true'
end
4 changes: 2 additions & 2 deletions spec/support/shared_examples/cache_failure.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

RSpec.shared_examples_for 'a Cache raises Error' do |func_name|
before { allow(redis_instance).to receive(func_name).and_raise(::Redis::BaseError) }
before { allow(redis_instance).to receive(func_name).and_raise(Redis::BaseError) }

let(:redis_instance) { RateLimit.config.redis = Redis.new }

Expand All @@ -10,6 +10,6 @@

after { RateLimit.config.fail_safe = true }

it { expect { subject }.to raise_error(::Redis::BaseError) }
it { expect { subject }.to raise_error(Redis::BaseError) }
end
end

0 comments on commit fcf685b

Please sign in to comment.