Skip to content
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
11 changes: 7 additions & 4 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [2.7, '3.0']
ruby: [3.4]
rails: ['~> 7', '~> 8']
env:
RAILS_VERSION: ${{ matrix.rails }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-202103-${{ hashFiles('**/Gemfile.lock') }}
Expand All @@ -27,6 +30,6 @@ jobs:
- name: Bundle install
run: bundle config path vendor/bundle
- name: Install dependencies
run: bin/setup
run: bundle install
- name: Run tests
run: bundle exec rake
15 changes: 3 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ gemspec
# engine_cart: 1.2.0
# engine_cart stanza: 0.10.0
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
file = File.expand_path('Gemfile',
ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app',
File.dirname(__FILE__)))
if File.exist?(file)
begin
eval_gemfile file
Expand All @@ -35,16 +37,5 @@ else
gem 'rails', ENV['RAILS_VERSION']
end
end

case ENV['RAILS_VERSION']
when /^5.[12]/
gem 'sass-rails', '~> 5.1'
when /^4.2/
gem 'responders', '~> 2.0'
gem 'sass-rails', '>= 5.0'
gem 'coffee-rails', '~> 4.1.0'
when /^4.[01]/
gem 'sass-rails', '< 5.0'
end
end
# END ENGINE_CART BLOCK
5 changes: 2 additions & 3 deletions annotot.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$:.push File.expand_path('../lib', __FILE__)
$:.push File.expand_path('lib', __dir__)

# Maintain your gem's version:
require 'annotot/version'
Expand All @@ -16,11 +16,10 @@ Gem::Specification.new do |s|

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

s.add_dependency 'rails', '>= 5.1', '< 8'
s.add_dependency 'rails', '>= 7.0', '< 9'

s.add_development_dependency 'engine_cart'
s.add_development_dependency 'factory_bot_rails'
s.add_development_dependency 'rails-controller-testing'
s.add_development_dependency 'rspec-rails'
s.add_development_dependency 'sqlite3'
end
2 changes: 1 addition & 1 deletion app/models/annotot/annotation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Annotation < ApplicationRecord
validates :uuid, presence: true, uniqueness: true
validates :canvas, presence: true

serialize :data, JSON
serialize :data, coder: JSON

##
# Used to differentiate between a numeric id and a uuid. Rails will trim a
Expand Down
12 changes: 12 additions & 0 deletions lib/annotot/engine.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
module Annotot
class Engine < ::Rails::Engine
isolate_namespace Annotot

config.before_configuration do
# see https://github.com/fxn/zeitwerk#for_gem
# Blacklight puts a generator into LOCAL APP lib/generators, so tell
# zeitwerk to ignore the whole directory? If we're using a recent
# enough version of Rails to have zeitwerk config
#
# See: https://github.com/cbeer/engine_cart/issues/117
if Rails.try(:autoloaders).try(:main).respond_to?(:ignore)
Rails.autoloaders.main.ignore(Rails.root.join('lib/generators'))
end
end
end
end