Skip to content

Commit

Permalink
Merge pull request #125 from projectblacklight/blacklight8
Browse files Browse the repository at this point in the history
Test with Blacklight 8.x
  • Loading branch information
hackartisan authored Feb 1, 2023
2 parents 3bf20e2 + 39e121f commit a0cdd21
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,29 @@ on:
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
ruby: [2.7, '3.0']
rails_version: ['6.1.7', '7.0.4']
blacklight_version: ['~> 7.0']
experimental: [false]
include:
- ruby: '3.1'
rails_version: '7.0.4'
blacklight_version: '~> 7.0'
experimental: false
- ruby: '3.1'
rails_version: '7.0.4'
blacklight_version: '8.0.0.beta1'
experimental: false
- ruby: '3.1'
rails_version: '7.0.4'
blacklight_version: 'github'
experimental: true
env:
RAILS_VERSION: ${{ matrix.rails_version }}
BLACKLIGHT_VERSION: ${{ matrix.blacklight_version }}
steps:
- uses: actions/checkout@v2
- name: Set up Ruby ${{ matrix.ruby }}
Expand Down
18 changes: 9 additions & 9 deletions lib/generators/blacklight_gallery/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ class Install < Rails::Generators::Base

source_root File.expand_path('../templates', __FILE__)

def assets
copy_file "blacklight_gallery.css.scss", "app/assets/stylesheets/blacklight_gallery.css.scss"
copy_file "blacklight_gallery.js", "app/assets/javascripts/blacklight_gallery.js"

insert_into_file "app/assets/javascripts/application.js", after: '//= require blacklight/blacklight' do
"\n//= require blacklight_gallery"
end
end

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)" \
Expand All @@ -35,5 +26,14 @@ def add_openseadragon
Bundler.with_clean_env { run 'bundle install' }
generate 'openseadragon:install'
end

def assets
copy_file "blacklight_gallery.css.scss", "app/assets/stylesheets/blacklight_gallery.css.scss"
copy_file "blacklight_gallery.js", "app/assets/javascripts/blacklight_gallery.js"

insert_into_file "app/assets/javascripts/application.js", after: '//= require blacklight/blacklight' do
"\n//= require blacklight_gallery"
end
end
end
end
5 changes: 5 additions & 0 deletions spec/test_app_templates/Gemfile.extra
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if ENV['BLACKLIGHT_VERSION'] == 'github'
gem 'blacklight', github: 'projectblacklight/blacklight'
elsif ENV['BLACKLIGHT_VERSION'] && !ENV['BLACKLIGHT_VERSION'].empty?
gem 'blacklight', ENV['BLACKLIGHT_VERSION']
end

0 comments on commit a0cdd21

Please sign in to comment.