Skip to content

Commit

Permalink
Merge pull request #78 from gocardless/rails-7
Browse files Browse the repository at this point in the history
Add support for Rails 7, drop support for Rails < 6
  • Loading branch information
JoeSouthan authored Dec 16, 2021
2 parents ae77194 + 18cc7fd commit 9fddab6
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 32 deletions.
14 changes: 6 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
type: string

docker:
- image: ruby:<<parameters.ruby-version>>
- image: cimg/ruby:<<parameters.ruby-version>>
environment:
- RAILS_VERSION=<<parameters.rails-version>>
steps:
Expand All @@ -18,7 +18,7 @@ jobs:
- restore_cache:
key: anony-bundler-{{ checksum "anony.gemspec" }}

- run: gem install bundler -v 2.2.0
- run: gem install bundler -v 2.2.33
- run: bundle config set path 'vendor/bundle'
- run: bundle install

Expand Down Expand Up @@ -47,10 +47,8 @@ workflows:
- test:
matrix:
parameters:
ruby-version: ["2.4", "2.5", "2.6", "2.7"]
rails-version: ["5.2", "6.0", "6.1"]
ruby-version: ["2.6", "2.7", "3.0"]
rails-version: ["6.0", "6.1", "7.0"]
exclude:
- ruby-version: "2.4"
rails-version: "6.0"
- ruby-version: "2.4"
rails-version: "6.1"
- ruby-version: "2.6"
rails-version: "7.0"
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ inherit_gem:
gc_ruboconfig: rubocop.yml

AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 3.0

Layout/LineLength:
Max: 100

Gemspec/RequiredRubyVersion:
Enabled: false
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.5
3.0.2
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v1.1.0

- Drop ruby 2.4 and 2.5 support
- Unpin ActiveSupport for Rails 7

# v1.0.2

- Unpin ActiveSupport for Rails 6
Expand Down
6 changes: 3 additions & 3 deletions anony.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
end
spec.require_paths = ["lib"]

spec.required_ruby_version = ">= 2.4"
spec.required_ruby_version = ">= 2.6"

spec.add_development_dependency "bundler", "~> 2.2.0"
spec.add_development_dependency "gc_ruboconfig", "~> 2.24.0"
Expand All @@ -33,6 +33,6 @@ Gem::Specification.new do |spec|
# For integration testing
spec.add_development_dependency "sqlite3", "~> 1.4.1"

spec.add_dependency "activerecord", ">= 5.2", "< 7"
spec.add_dependency "activesupport", ">= 5.2", "< 7"
spec.add_dependency "activerecord", ">= 5.2", "< 8"
spec.add_dependency "activesupport", ">= 5.2", "< 8"
end
2 changes: 1 addition & 1 deletion lib/anony/cops/define_deletion_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module Lint
# class MyNewThing < ApplicationRecord; end
class DefineDeletionStrategy < Cop
MSG = "Define .anonymise for %<model>s, see https://github.com/gocardless/" \
"anony/blob/#{Anony::VERSION}/README.md for details"
"anony/blob/#{Anony::VERSION}/README.md for details".freeze

def_node_search :uses_anonymise?, "(send nil? :anonymise)"

Expand Down
2 changes: 1 addition & 1 deletion lib/anony/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Anony
VERSION = "1.0.2"
VERSION = "1.1.0"
end
10 changes: 4 additions & 6 deletions spec/anony/anonymisable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,10 @@ def some_instance_method?

context "with ignored fields in Anony::Config" do
around do |example|
begin
original_ignores = Anony::Config.ignores
example.call
ensure
Anony::Config.ignores = original_ignores
end
original_ignores = Anony::Config.ignores
example.call
ensure
Anony::Config.ignores = original_ignores
end

before { Anony::Config.ignore_fields(:id) }
Expand Down
10 changes: 4 additions & 6 deletions spec/anony/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

RSpec.describe Anony::Config do
around do |example|
begin
original_ignores = described_class.ignores
example.call
ensure
described_class.ignores = original_ignores
end
original_ignores = described_class.ignores
example.call
ensure
described_class.ignores = original_ignores
end

describe ".ignore?" do
Expand Down
8 changes: 3 additions & 5 deletions spec/anony/field_level_strategies_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
let(:name) { :reverse }

after do
begin
described_class.undef_method(name)
rescue StandardError
nil
end
described_class.undef_method(name)
rescue StandardError
nil
end

context "with a block" do
Expand Down

0 comments on commit 9fddab6

Please sign in to comment.