diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9abb6e9..9dba7cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: ruby-version: ['3.1', '3.2'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -30,25 +30,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - gemfile: ['6.0_stable', '6.1_stable', '7.0_stable', '7.1_stable'] - ruby-version: ['2.5', '2.6', '2.7', '3.0', '3.1', '3.2'] - exclude: - - ruby-version: '3.2' - gemfile: '6.0_stable' - - ruby-version: '3.1' - gemfile: '6.0_stable' - - ruby-version: '2.5' - gemfile: '7.0_stable' - - ruby-version: '2.6' - gemfile: '7.0_stable' - - ruby-version: '2.5' - gemfile: '7.1_stable' - - ruby-version: '2.6' - gemfile: '7.1_stable' + gemfile: ['6.1_stable', '7.0_stable', '7.1_stable'] + ruby-version: ['3.1', '3.2', '3.3'] env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.rubocop.yml b/.rubocop.yml index 070a4ea..b68ef0b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -13,7 +13,7 @@ AllCops: - 'vendor/**/*' - 'gemfiles/**/*' - Gemfile - TargetRubyVersion: 2.5 + TargetRubyVersion: 3.1 DisplayCopNames: true Bundler: diff --git a/Appraisals b/Appraisals index 254da18..c1f4199 100644 --- a/Appraisals +++ b/Appraisals @@ -1,17 +1,16 @@ # frozen_string_literal: true -appraise '6.0-stable' do - gem 'activerecord', '~> 6.0.0' -end - appraise '6.1-stable' do gem 'activerecord', '~> 6.1.0' + gem 'sqlite3', '~> 1.7.0' end appraise '7.0-stable' do gem 'activerecord', '~> 7.0.0' + gem 'sqlite3', '~> 1.7.0' end appraise '7.1-stable' do gem 'activerecord', '~> 7.1.0' + gem 'sqlite3', '~> 1.7.0' end diff --git a/CHANGELOG.md b/CHANGELOG.md index 73597c3..e74e218 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Next Version +* **Breaking Changes** Rails 6.0 is no longer supported. #28 + ## 1.0.0 * **Breaking Changes** Rails 5.0, 5.1 and 5.2 are no longer supported. #23 diff --git a/active_record_bitmask.gemspec b/active_record_bitmask.gemspec index 3765676..6f34c69 100644 --- a/active_record_bitmask.gemspec +++ b/active_record_bitmask.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |spec| spec.summary = 'Simple bitmask attribute support for ActiveRecord' spec.homepage = 'https://github.com/alpaca-tc/active_record_bitmask' - spec.required_ruby_version = '>= 2.5.0' + spec.required_ruby_version = '>= 3.1.0' spec.metadata = { 'homepage_uri' => 'https://github.com/alpaca-tc/active_record_bitmask', @@ -28,5 +28,5 @@ Gem::Specification.new do |spec| end spec.require_paths = ['lib'] - spec.add_dependency 'activerecord', '>= 6.0' + spec.add_dependency 'activerecord', '>= 6.1' end diff --git a/gemfiles/5.0_stable.gemfile b/gemfiles/5.0_stable.gemfile deleted file mode 100644 index e36e5b4..0000000 --- a/gemfiles/5.0_stable.gemfile +++ /dev/null @@ -1,13 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "pry" -gem "rubocop", "0.86.0" -gem "appraisal" -gem "rake" -gem "rspec" -gem "sqlite3", "~> 1.3.6" -gem "activerecord", "~> 5.0.0" - -gemspec path: "../" diff --git a/gemfiles/5.1_stable.gemfile b/gemfiles/5.1_stable.gemfile deleted file mode 100644 index 81fb981..0000000 --- a/gemfiles/5.1_stable.gemfile +++ /dev/null @@ -1,13 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "pry" -gem "rubocop", "0.86.0" -gem "appraisal" -gem "rake" -gem "rspec" -gem "sqlite3" -gem "activerecord", "~> 5.1.0" - -gemspec path: "../" diff --git a/gemfiles/5.2_stable.gemfile b/gemfiles/5.2_stable.gemfile deleted file mode 100644 index ee1c52d..0000000 --- a/gemfiles/5.2_stable.gemfile +++ /dev/null @@ -1,13 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "pry" -gem "rubocop", "0.86.0" -gem "appraisal" -gem "rake" -gem "rspec" -gem "sqlite3" -gem "activerecord", "~> 5.2.0" - -gemspec path: "../" diff --git a/gemfiles/6.0_stable.gemfile b/gemfiles/6.0_stable.gemfile deleted file mode 100644 index 1488f8d..0000000 --- a/gemfiles/6.0_stable.gemfile +++ /dev/null @@ -1,13 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "pry" -gem "rubocop", "1.28.2" -gem "appraisal" -gem "rake" -gem "rspec" -gem "sqlite3" -gem "activerecord", "~> 6.0.0" - -gemspec path: "../" diff --git a/gemfiles/6.1_stable.gemfile b/gemfiles/6.1_stable.gemfile index cc536b6..e6d5b82 100644 --- a/gemfiles/6.1_stable.gemfile +++ b/gemfiles/6.1_stable.gemfile @@ -7,7 +7,7 @@ gem "rubocop", "1.28.2" gem "appraisal" gem "rake" gem "rspec" -gem "sqlite3" +gem "sqlite3", "~> 1.7.0" gem "activerecord", "~> 6.1.0" gemspec path: "../" diff --git a/gemfiles/7.0_stable.gemfile b/gemfiles/7.0_stable.gemfile index aee4d3b..fb5e465 100644 --- a/gemfiles/7.0_stable.gemfile +++ b/gemfiles/7.0_stable.gemfile @@ -7,7 +7,7 @@ gem "rubocop", "1.28.2" gem "appraisal" gem "rake" gem "rspec" -gem "sqlite3" +gem "sqlite3", "~> 1.7.0" gem "activerecord", "~> 7.0.0" gemspec path: "../" diff --git a/gemfiles/7.1_stable.gemfile b/gemfiles/7.1_stable.gemfile index ce852d7..0073819 100644 --- a/gemfiles/7.1_stable.gemfile +++ b/gemfiles/7.1_stable.gemfile @@ -7,7 +7,7 @@ gem "rubocop", "1.28.2" gem "appraisal" gem "rake" gem "rspec" -gem "sqlite3" +gem "sqlite3", "~> 1.7.0" gem "activerecord", "~> 7.1.0" gemspec path: "../" diff --git a/lib/active_record_bitmask/model.rb b/lib/active_record_bitmask/model.rb index 550f262..d6caf1d 100644 --- a/lib/active_record_bitmask/model.rb +++ b/lib/active_record_bitmask/model.rb @@ -51,21 +51,16 @@ def bitmask_for(attribute) private def define_bitmask_attribute(attribute, map) - if ActiveRecord.gem_version >= Gem::Version.new('7.0.0.alpha1') + if ActiveRecord.gem_version >= Gem::Version.new('7.0.0') # Greater than or equal to 7.0.0 attribute(attribute) do |subtype| ActiveRecordBitmask::BitmaskType.new(attribute, map, subtype) end - elsif ActiveRecord.gem_version >= Gem::Version.new('6.1.0') + else # Equal to 6.1.0 decorate_attribute_type(attribute) do |subtype| ActiveRecordBitmask::BitmaskType.new(attribute, map, subtype) end - else - # Less than 6.1.0 - decorate_attribute_type(attribute, :bitmask) do |subtype| - ActiveRecordBitmask::BitmaskType.new(attribute, map, subtype) - end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e8e47b8..5c40f8c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -29,4 +29,4 @@ end end -Dir['./spec/support/**/*.rb'].sort.each { |f| require f } +Dir['./spec/support/**/*.rb'].each { |f| require f }