Skip to content

Commit

Permalink
Merge pull request #117 from projectblacklight/rails7
Browse files Browse the repository at this point in the history
Add compatibility with Rails 7
  • Loading branch information
corylown committed Mar 1, 2022
2 parents ac60d71 + b511563 commit 310ca9c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 30 deletions.
29 changes: 9 additions & 20 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
rails_version: [6.1.1]
ruby: [2.7, '3.0']
env:
RAILS_VERSION: ${{ matrix.rails_version }}
steps:
- uses: actions/checkout@v2
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies with Rails ${{ matrix.rails_version }}
run: bundle install
- name: Run tests
run: bundle exec rake
test_rails52:
runs-on: ubuntu-latest
strategy:
matrix:
rails_version: [5.2.4.4, 6.0.3.4]
ruby: [2.7]
rails_version: [6.1.4.6]
ruby: ['2.7', '3.0']
include:
- rails_version: 7.0.2.2
ruby: '3.0'
- rails_version: 5.2.4.4
ruby: '2.7'
- rails_version: 6.0.3.4
ruby: '2.7'
env:
RAILS_VERSION: ${{ matrix.rails_version }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion blacklight-gallery.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_dependency "rails", '>= 5.1', '< 7'
spec.add_dependency "rails", '>= 5.1', '< 8'
spec.add_dependency 'blacklight', '~> 7.17'

spec.add_development_dependency "rake"
Expand Down
7 changes: 3 additions & 4 deletions lib/generators/blacklight_gallery/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ def assets

def configuration
inject_into_file 'app/controllers/catalog_controller.rb', after: "configure_blacklight do |config|" do
"\n config.view.gallery.document_component = Blacklight::Gallery::DocumentComponent" \
"\n # config.view.gallery.classes = 'row-cols-2 row-cols-md-3'" \
"\n config.view.masonry.document_component = Blacklight::Gallery::DocumentComponent" \
"\n config.view.slideshow.document_component = Blacklight::Gallery::SlideshowComponent" \
"\n config.view.gallery(document_component: Blacklight::Gallery::DocumentComponent)" \
"\n config.view.masonry(document_component: Blacklight::Gallery::DocumentComponent)" \
"\n config.view.slideshow(document_component: Blacklight::Gallery::SlideshowComponent)" \
"\n config.show.tile_source_field = :content_metadata_image_iiif_info_ssm" \
"\n config.show.partials.insert(1, :openseadragon)"
end
Expand Down
1 change: 0 additions & 1 deletion spec/test_app_templates/Gemfile.extra
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
gem 'sprockets', '< 4'
2 changes: 1 addition & 1 deletion spec/views/catalog/_document_slideshow.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper'

describe "catalog/_document_slideshow.html.erb", :type => :view do
describe "catalog/_document_slideshow", :type => :view do
let(:blacklight_config) do
Blacklight::Configuration.new do |config|
config.track_search_session = false
Expand Down
6 changes: 3 additions & 3 deletions spec/views/catalog/_openseadragon_default.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe "catalog/openseadragon_default" do
let(:document) { SolrDocument.new }
let(:blacklight_config) { Blacklight::Configuration.new }
let(:p) { "catalog/openseadragon_default.html.erb" }
let(:p) { "catalog/openseadragon_default" }

before do
allow(view).to receive_messages(blacklight_config: blacklight_config, openseadragon_picture_tag: "<img />")
Expand All @@ -14,9 +14,9 @@
render partial: p, locals: { document: document }
expect(rendered).to have_selector ".openseadragon-container"
end

it "should support passing a container class" do
render partial: p, locals: { document: document, osd_container_class: "custom-container" }
expect(rendered).to have_selector ".custom-container"
end
end
end

0 comments on commit 310ca9c

Please sign in to comment.