Skip to content

Commit de4bc57

Browse files
committed
Support Rails 7 + 8
1 parent 2c0c097 commit de4bc57

4 files changed

Lines changed: 13 additions & 19 deletions

File tree

.github/workflows/ruby.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
ruby: [2.7, '3.0']
14+
ruby: [3.4]
15+
rails: [7, 8]
16+
env:
17+
RAILS_VERSION: "~> ${{ matrix.rails }}"
1518
steps:
16-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
1720
- name: Set up Ruby
1821
uses: ruby/setup-ruby@v1
1922
with:
2023
ruby-version: ${{ matrix.ruby }}
21-
- uses: actions/cache@v2
24+
- uses: actions/cache@v4
2225
with:
2326
path: vendor/bundle
2427
key: ${{ runner.os }}-gems-202103-${{ hashFiles('**/Gemfile.lock') }}
@@ -27,6 +30,6 @@ jobs:
2730
- name: Bundle install
2831
run: bundle config path vendor/bundle
2932
- name: Install dependencies
30-
run: bin/setup
33+
run: bundle install
3134
- name: Run tests
3235
run: bundle exec rake

Gemfile

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ gemspec
1616
# engine_cart: 1.2.0
1717
# engine_cart stanza: 0.10.0
1818
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
19-
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
19+
file = File.expand_path('Gemfile',
20+
ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app',
21+
File.dirname(__FILE__)))
2022
if File.exist?(file)
2123
begin
2224
eval_gemfile file
@@ -35,16 +37,5 @@ else
3537
gem 'rails', ENV['RAILS_VERSION']
3638
end
3739
end
38-
39-
case ENV['RAILS_VERSION']
40-
when /^5.[12]/
41-
gem 'sass-rails', '~> 5.1'
42-
when /^4.2/
43-
gem 'responders', '~> 2.0'
44-
gem 'sass-rails', '>= 5.0'
45-
gem 'coffee-rails', '~> 4.1.0'
46-
when /^4.[01]/
47-
gem 'sass-rails', '< 5.0'
48-
end
4940
end
5041
# END ENGINE_CART BLOCK

annotot.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$:.push File.expand_path('../lib', __FILE__)
1+
$:.push File.expand_path('lib', __dir__)
22

33
# Maintain your gem's version:
44
require 'annotot/version'
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
1616

1717
s.files = Dir['{app,config,db,lib}/**/*', 'LICENSE', 'Rakefile', 'README.md']
1818

19-
s.add_dependency 'rails', '>= 5.1', '< 8'
19+
s.add_dependency 'rails', '>= 7.0', '< 9'
2020

2121
s.add_development_dependency 'engine_cart'
2222
s.add_development_dependency 'factory_bot_rails'

app/models/annotot/annotation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class Annotation < ApplicationRecord
33
validates :uuid, presence: true, uniqueness: true
44
validates :canvas, presence: true
55

6-
serialize :data, JSON
6+
serialize :data, coder: JSON
77

88
##
99
# Used to differentiate between a numeric id and a uuid. Rails will trim a

0 commit comments

Comments
 (0)