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

Update Ruby and gem versions #135

Merged
merged 6 commits into from
Aug 24, 2023
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
53 changes: 43 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Run Rubocop and RSpec

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
rubocop:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
Expand All @@ -19,12 +19,15 @@ jobs:
- name: Run Rubocop
run: bundle exec rake rubocop

test-on-mysql:
runs-on: ubuntu-18.04

# MySQL 5.7 is not supported on Ubuntu 22, therefore using MacOS for this
# version
test-on-mysql-5-7:
runs-on: macos-13
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0', '3.1']
mysql-version: ['5.7', '8.0']
ruby-version: ['2.7', '3.0', '3.1']
mysql-version: ['5.7']

steps:
- uses: actions/checkout@v2
Expand All @@ -45,12 +48,42 @@ jobs:
DB_HOST: 127.0.0.1
DB_USER: root


test-on-mysql-8:
runs-on: ubuntu-22.04
strategy:
matrix:
ruby-version: ['2.7', '3.0', '3.1', '3.2']
mysql-version: ['8.0']

steps:
- uses: actions/checkout@v2
- uses: ankane/setup-mysql@v1
with:
mysql-version: ${{ matrix.mysql-version }}
- name: Create the test database
run: mysqladmin create rails_cursor_pagination_testing
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rake spec
env:
DB_ADAPTER: mysql2
DB_HOST: 127.0.0.1
DB_USER: root


test-on-postgres:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0', '3.1']
postgres-version: [14, 13, 12]
ruby-version: ['2.7', '3.0', '3.1', '3.2']
postgres-version: [12, 13, 14, 15]
env:
BUNDLE_GEMFILE: Gemfile-postgres

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 2.7
NewCops: enable

Metrics/AbcSize:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.7.5
ruby-3.0.6
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ These are the latest changes on the project's `master` branch that have not yet
Follow the same format as previous releases by categorizing your feature into "Added", "Changed", "Deprecated", "Removed", "Fixed", or "Security".
--->

### Changed
- Raised minimum required Ruby version to 2.7
- Raised minimum required `activerecord` version to 6.0

### Added
- Test against Ruby version 3.2

## [0.3.0] - 2022-07-08

### Added
Expand Down
10 changes: 4 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in rails_cursor_pagination.gemspec
gemspec

gem 'rake', '~> 13.0'
gem 'rake'

gem 'rspec', '~> 3.11'
gem 'rspec'

gem 'rubocop', '~> 1.31'
gem 'rubocop'

gem 'mysql2', '~> 0.5'

gem 'pg', '~> 1.4'
gem 'mysql2'
14 changes: 14 additions & 0 deletions Gemfile-postgres
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Specify your gem's dependencies in rails_cursor_pagination.gemspec
gemspec

gem 'rake'

gem 'rspec'

gem 'rubocop'

gem 'pg'
82 changes: 82 additions & 0 deletions Gemfile-postgres.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
PATH
remote: .
specs:
rails_cursor_pagination (0.3.0)
activerecord (>= 6.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (7.0.7.2)
activesupport (= 7.0.7.2)
activerecord (7.0.7.2)
activemodel (= 7.0.7.2)
activesupport (= 7.0.7.2)
activesupport (7.0.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
ast (2.4.2)
base64 (0.1.1)
concurrent-ruby (1.2.2)
diff-lcs (1.5.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
language_server-protocol (3.17.0.3)
minitest (5.19.0)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
pg (1.5.3)
racc (1.7.1)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.1)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.56.1)
base64 (~> 0.1.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)

PLATFORMS
ruby

DEPENDENCIES
pg
rails_cursor_pagination!
rake
rspec
rubocop

BUNDLED WITH
2.2.33
92 changes: 48 additions & 44 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,83 @@ PATH
remote: .
specs:
rails_cursor_pagination (0.3.0)
activerecord (>= 5.0)
activerecord (>= 6.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (6.1.6)
activesupport (= 6.1.6)
activerecord (6.1.6)
activemodel (= 6.1.6)
activesupport (= 6.1.6)
activesupport (6.1.6)
activemodel (6.1.7.6)
activesupport (= 6.1.7.6)
activerecord (6.1.7.6)
activemodel (= 6.1.7.6)
activesupport (= 6.1.7.6)
activesupport (6.1.7.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
ast (2.4.2)
concurrent-ruby (1.1.10)
base64 (0.1.1)
concurrent-ruby (1.2.2)
diff-lcs (1.5.0)
i18n (1.10.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.2)
minitest (5.15.0)
mysql2 (0.5.4)
parallel (1.22.1)
parser (3.1.2.0)
json (2.6.3)
language_server-protocol (3.17.0.3)
minitest (5.19.0)
mysql2 (0.5.5)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
pg (1.4.1)
racc
racc (1.7.1)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.5.0)
rexml (3.2.5)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
regexp_parser (2.8.1)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubocop (1.31.2)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.56.1)
base64 (~> 0.1.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.1.0.0)
parser (>= 3.2.2.3)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.18.0, < 2.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.18.0)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
tzinfo (2.0.4)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.2.0)
zeitwerk (2.5.4)
unicode-display_width (2.4.2)
zeitwerk (2.6.11)

PLATFORMS
ruby

DEPENDENCIES
mysql2 (~> 0.5)
pg (~> 1.4)
mysql2
rails_cursor_pagination!
rake (~> 13.0)
rspec (~> 3.11)
rubocop (~> 1.31)
rake
rspec
rubocop

BUNDLED WITH
2.1.4
2.2.33
2 changes: 2 additions & 0 deletions lib/rails_cursor_pagination/cursor.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'base64'

module RailsCursorPagination
# Cursor class that's used to uniquely identify a record and serialize and
# deserialize this cursor so that it can be used for pagination.
Expand Down
4 changes: 2 additions & 2 deletions rails_cursor_pagination.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
'regardless of changes to the base relation.'
spec.homepage = 'https://github.com/xing/rails_cursor_pagination'
spec.license = 'MIT'
spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')

spec.metadata['homepage_uri'] = spec.homepage
spec.metadata['source_code_uri'] = spec.homepage
Expand All @@ -38,5 +38,5 @@ Gem::Specification.new do |spec|
])
spec.require_paths = ['lib']

spec.add_dependency 'activerecord', '>= 5.0'
spec.add_dependency 'activerecord', '>= 6.0'
end
Loading
Loading