Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ruby 3.0 & 3.1 #19

Merged
merged 13 commits into from
Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ AllCops:
- "vendor/**/*"
Metrics/AbcSize:
Max: 40
Metrics/LineLength:
Max: 125
AllowURI: true
URISchemes:
- http
- https
Metrics/MethodLength:
Max: 20
Metrics/CyclomaticComplexity:
Expand All @@ -21,18 +15,36 @@ Metrics/PerceivedComplexity:
Max: 10
Metrics/BlockLength:
Enabled: false
Documentation:
Style/Documentation:
Enabled: false
Style/SignalException:
EnforcedStyle: only_raise
Layout/IndentHash:
Layout/LineLength:
Max: 125
AllowURI: true
URISchemes:
- http
- https
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
Layout/IndentArray:
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Layout/EndAlignment:
EnforcedStyleAlignWith: variable
Lint/InheritException:
Enabled: false
Lint/SendWithMixinArgument:
Enabled: false
Lint/RaiseException:
Enabled: false
Lint/StructNewOverride:
Enabled: false
Style/HashEachMethods:
Enabled: false
Style/HashTransformKeys:
Enabled: false
Style/HashTransformValues:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
RSpec/AnyInstance:
Expand Down
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ rvm:
- 2.5
- 2.6
- 2.7
- 3.0
- 3.1
env:
jobs:
-
Expand All @@ -13,6 +15,8 @@ env:
- ACTIVE_RECORD_VERSION=4.2.0 SQLITE3_VERSION=1.3.13
- ACTIVE_RECORD_VERSION=5.0.0 SQLITE3_VERSION=1.3.13
- ACTIVE_RECORD_VERSION=6.0.0
- ACTIVE_RECORD_VERSION=6.1.0
- ACTIVE_RECORD_VERSION=7.0.0
matrix:
allow_failures:
- rvm: 2.4
Expand All @@ -33,8 +37,36 @@ matrix:
env: ACTIVE_RECORD_VERSION=4.1.0 SQLITE3_VERSION=1.3.13
- rvm: 2.7
env: ACTIVE_RECORD_VERSION=4.2.0 SQLITE3_VERSION=1.3.13
- rvm: 3.0
env: ACTIVE_RECORD_VERSION=4.0.0 SQLITE3_VERSION=1.3.13
- rvm: 3.0
env: ACTIVE_RECORD_VERSION=4.1.0 SQLITE3_VERSION=1.3.13
- rvm: 3.0
env: ACTIVE_RECORD_VERSION=4.2.0 SQLITE3_VERSION=1.3.13
- rvm: 3.0
env: ACTIVE_RECORD_VERSION=5.0.0 SQLITE3_VERSION=1.3.13
- rvm: 3.1
env: ACTIVE_RECORD_VERSION=4.0.0 SQLITE3_VERSION=1.3.13
- rvm: 3.1
env: ACTIVE_RECORD_VERSION=4.1.0 SQLITE3_VERSION=1.3.13
- rvm: 3.1
env: ACTIVE_RECORD_VERSION=4.2.0 SQLITE3_VERSION=1.3.13
- rvm: 3.1
env: ACTIVE_RECORD_VERSION=5.0.0 SQLITE3_VERSION=1.3.13
- rvm: 2.4
env: ACTIVE_RECORD_VERSION=6.0.0
- rvm: 3.0
env: ACTIVE_RECORD_VERSION=6.0.0
- rvm: 3.1
env: ACTIVE_RECORD_VERSION=6.0.0
- rvm: 2.4
env: ACTIVE_RECORD_VERSION=6.1.0
- rvm: 2.4
env: ACTIVE_RECORD_VERSION=7.0.0
- rvm: 2.5
env: ACTIVE_RECORD_VERSION=7.0.0
- rvm: 2.6
env: ACTIVE_RECORD_VERSION=7.0.0
before_install:
- gem update --system
- gem --version
Expand Down
6 changes: 3 additions & 3 deletions acts_as_hashids.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ Gem::Specification.new do |spec|
spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.required_ruby_version = ['>= 2.2.2', '< 3.0']
spec.required_ruby_version = ['>= 2.3.0', '< 3.2']

spec.add_runtime_dependency 'activerecord', '>= 4.0', '< 6.1'
spec.add_runtime_dependency 'activerecord', '>= 4.0', '< 7.1'
spec.add_runtime_dependency 'hashids', '~> 1.0'

spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.5'
spec.add_development_dependency 'coveralls', '~> 0.8'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rubocop', '~> 0.54.0'
spec.add_development_dependency 'rubocop', '~> 0.81.0'
spec.add_development_dependency 'rubocop-rspec', '~> 1.24.0'
spec.add_development_dependency 'simplecov', '~> 0.11'
spec.add_development_dependency 'sqlite3', '~> 1.3'
Expand Down
4 changes: 2 additions & 2 deletions lib/acts_as_hashids/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def with_hashids(*ids)
where(primary_key => decoded_ids)
end

def has_many(*args, &block) # rubocop:disable Style/PredicateName
def has_many(*args, &block) # rubocop:disable Naming/PredicateName
options = args.extract_options!
options[:extend] = (options[:extend] || []).concat([FinderMethods])
super(*args, options, &block)
super(*args, **options, &block)
end

def relation
Expand Down