Skip to content

Commit 0e816c0

Browse files
committed
Begin v4
- Remove support for many unsupported versions of Ruby + Rails - Add new versions of Ruby + Rails
1 parent d820088 commit 0e816c0

9 files changed

Lines changed: 43 additions & 49 deletions

File tree

.github/workflows/main.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
ruby_version: ['3.0', '3.1', '3.2', '3.3']
17-
rails_version: ['6.1', '7.0', '7.1']
16+
ruby_version: ['3.2', '3.3', '3.4', '4.0']
17+
rails_version: ['7.2', '8.0', '8.1']
1818
exclude:
19-
- ruby_version: 3.1
20-
rails_version: 6.1
21-
- ruby_version: 3.2
22-
rails_version: 6.1
23-
- ruby_version: 3.3
24-
rails_version: 6.1
19+
- ruby_version: 4.0
20+
rails_version: 7.2
21+
- ruby_version: 4.0
22+
rails_version: 8.0
2523
steps:
2624
- uses: actions/checkout@v4
2725
- name: Setup Ruby
@@ -30,6 +28,8 @@ jobs:
3028
ruby-version: ${{ matrix.ruby_version }}
3129
- name: Build and run test
3230
run: |
33-
bundle
31+
bundle install
32+
unset BUNDLE_GEMFILE
3433
bundle exec appraisal rails_${{ matrix.rails_version }} bundle
3534
bundle exec appraisal rails_${{ matrix.rails_version }} rake
35+

Appraisals

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# frozen_string_literal: true
22

3-
if RUBY_VERSION.to_f < 3.1
4-
appraise 'rails_6.1' do
5-
gem 'rails', '~> 6.1.0'
6-
gem 'openssl'
3+
if RUBY_VERSION.to_f < 4.0
4+
appraise 'rails_7.2' do
5+
gem 'rails', '~> 7.2.0'
76
end
8-
end
97

10-
appraise 'rails_7.0' do
11-
gem 'rails', '~> 7.0.1'
8+
appraise 'rails_8.0' do
9+
gem 'rails', '~> 8.0.0'
10+
end
1211
end
1312

14-
appraise 'rails_7.1' do
15-
gem 'rails', '~> 7.1.0'
13+
appraise 'rails_8.1' do
14+
gem 'rails', '~> 8.1.0'
15+
gem "sqlite3", "~> 2.1"
1616
end

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 4.0.0
4+
5+
- **Removed** Ruby <= 3.1 support
6+
- **Removed** Rails <= 7.1 support
7+
38
## 3.0.2
49

510
- **Fixed** Refactor prepare_parameters method to handle nil parameters (s. #387, thanks [Himalaya Pal](https://github.com/palhimalaya))

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ recorded activities to users - similarly to how GitHub does it.
2929

3030
## Ruby/Rails version support
3131

32-
Version `~> 3.0`` supports Ruby 3.0+ and Rails 6.1+. For older Ruby versions
33-
(≤2.7) and Rails 5.0+ you can use version `~> 2.0` until you can upgrade to
34-
newer versions of Ruby + Rails.
32+
- Version `~> 4.0` supports Ruby 3.2+ and Rails 7.2+
33+
- Version `~> 3.0` supports Ruby 3.0+ and Rails 6.1+ (unsupported)
34+
- Version `~> 2.0` supports Ruby ≤2.7 and Rails 5.0+ (unsupported)
3535

3636
Issues related to those unsupported versions of Ruby/Rails will be closed
3737
without resolution and PRs will not be accepted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
source "https://rubygems.org"
44

5-
gem "rails", "~> 7.0.1"
5+
gem "rails", "~> 7.2.0"
66

77
gemspec path: "../"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
source "https://rubygems.org"
44

5-
gem "rails", "~> 7.1.0"
5+
gem "rails", "~> 8.0.0"
66

77
gemspec path: "../"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source "https://rubygems.org"
44

5-
gem "rails", "~> 6.1.0"
6-
gem "openssl"
5+
gem "rails", "~> 8.1.0"
6+
gem "sqlite3", "~> 2.1"
77

88
gemspec path: "../"

public_activity.gemspec

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ Gem::Specification.new do |s|
2222
"rubygems_mfa_required" => "true",
2323
}
2424

25-
s.files = `git ls-files lib`.split("\n") + ['Gemfile', 'Rakefile', 'README.md', 'MIT-LICENSE']
25+
s.files = `git ls-files lib`.split("\n") + %w[Gemfile Rakefile README.md MIT-LICENSE CHANGELOG.md]
2626
s.test_files = `git ls-files test`.split("\n")
2727
s.require_paths = ['lib']
2828

29-
s.required_ruby_version = '>= 3.0.0'
29+
s.required_ruby_version = '>= 3.2.0'
3030

3131
s.post_install_message = File.read('UPGRADING') if File.exist?('UPGRADING')
3232

33-
s.add_dependency 'actionpack', '>= 6.1'
33+
s.add_dependency 'actionpack', '>= 7.2'
3434
s.add_dependency 'i18n', '>= 0.5.0'
35-
s.add_dependency 'railties', '>= 6.1'
35+
s.add_dependency 'railties', '>= 7.2'
3636

3737
ENV['PA_ORM'] ||= 'active_record'
3838
case ENV['PA_ORM']
3939
when 'active_record'
40-
s.add_dependency 'activerecord', '>= 6.1'
40+
s.add_dependency 'activerecord', '>= 7.2'
4141
when 'mongoid'
4242
s.add_dependency 'mongoid', '>= 4.0'
4343
when 'mongo_mapper'
@@ -52,7 +52,7 @@ Gem::Specification.new do |s|
5252
s.add_development_dependency 'pry'
5353
s.add_development_dependency 'redcarpet'
5454
s.add_development_dependency 'simplecov'
55-
s.add_development_dependency 'sqlite3', '~> 1.4'
55+
s.add_development_dependency 'sqlite3', '~> 2.1'
5656
s.add_development_dependency 'test-unit'
5757
s.add_development_dependency 'yard'
5858
s.add_development_dependency 'rake'

test/test_helper.rb

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,13 @@
3030
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
3131

3232
migrations_path = File.expand_path('migrations', __dir__)
33-
active_record_version = ActiveRecord.version.release
34-
35-
if active_record_version >= Gem::Version.new('7.2.0')
36-
migration_context = ActiveRecord::MigrationContext.new(migrations_path)
37-
migrations = migration_context.migrations # => Array<ActiveRecord::MigrationProxy>
38-
connection_pool = ActiveRecord::Tasks::DatabaseTasks.migration_connection_pool
39-
schema_migration = ActiveRecord::SchemaMigration.new(connection_pool)
40-
internal_metadata = ActiveRecord::InternalMetadata.new(connection_pool)
41-
42-
ActiveRecord::Migrator.new(
43-
:up,
44-
migrations,
45-
schema_migration,
46-
internal_metadata
47-
).migrate
48-
else
49-
ActiveRecord::MigrationContext.new(migrations_path, ActiveRecord::SchemaMigration).migrate
50-
end
33+
migration_context = ActiveRecord::MigrationContext.new(migrations_path)
34+
migrations = migration_context.migrations # => Array<ActiveRecord::MigrationProxy>
35+
connection_pool = ActiveRecord::Tasks::DatabaseTasks.migration_connection_pool
36+
schema_migration = ActiveRecord::SchemaMigration.new(connection_pool)
37+
internal_metadata = ActiveRecord::InternalMetadata.new(connection_pool)
38+
39+
ActiveRecord::Migrator.new(:up, migrations, schema_migration, internal_metadata).migrate
5140

5241
$stdout = STDOUT
5342

0 commit comments

Comments
 (0)