Skip to content

Commit

Permalink
Merge pull request #1038 from projectblacklight/rails7
Browse files Browse the repository at this point in the history
Support Rails 7
  • Loading branch information
thatbudakguy authored Jun 23, 2022
2 parents 57f7792 + 144b505 commit b224ab5
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 30 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
rails_version: [6.1.4.7]
rails_version: [6.1.4.7, 7.0.2.3]
ruby: [2.7, '3.0']
include:
- rails_version: 6.0.3.7
ruby: 2.7
- rails_version: 5.2.6.3
ruby: 2.6
env:
RAILS_VERSION: ${{ matrix.rails_version }}
steps:
Expand Down
11 changes: 5 additions & 6 deletions arclight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,17 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

spec.add_dependency 'blacklight', '~> 7.2'
spec.add_dependency 'blacklight_range_limit', '~> 7.1'
spec.add_dependency 'rails', '>= 5.2.3', '< 6.2'
spec.add_dependency 'blacklight_range_limit', '>= 7.1', '< 9'
spec.add_dependency 'rails', '>= 6', '< 7.1'
spec.add_dependency 'rexml'
spec.add_dependency 'sprockets-bumble_d'
spec.add_dependency 'traject', '~> 3.0'
spec.add_dependency 'traject_plus', '~> 1.2'
spec.add_dependency 'traject_plus', '~> 2.0'

spec.add_development_dependency 'bundler', '> 1.14'
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'capybara'
spec.add_development_dependency 'engine_cart'
spec.add_development_dependency 'i18n-tasks'
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_development_dependency 'rake', '>= 12.0'
spec.add_development_dependency 'rspec-rails'
spec.add_development_dependency 'rubocop', '~> 1.8'
spec.add_development_dependency 'rubocop-rails', '~> 2.8'
Expand Down
12 changes: 3 additions & 9 deletions lib/arclight/engine.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require 'sprockets/bumble_d'
require 'blacklight'
require 'traject'
require 'active_model'
Expand All @@ -15,13 +14,6 @@ module Arclight
##
# This is the defining class for the Arclight Rails Engine
class Engine < ::Rails::Engine
extend ::Sprockets::BumbleD::DSL

# We're not sure this is right, but we aren't doing module imports
# at the moment anyway
register_umd_globals :arclight,
'blacklight' => 'Blacklight'

config.viewer_class = Arclight::Viewers::OEmbed
config.oembed_resource_exclude_patterns = [/\.pdf$/, /\.ppt$/]

Expand Down Expand Up @@ -60,7 +52,9 @@ class Engine < ::Rails::Engine
end

initializer 'arclight.helpers' do
ActionView::Base.send :include, ArclightHelper
config.after_initialize do
ActionView::Base.send :include, ArclightHelper
end
end
end
end
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"description": "",
"main": "index.js",
"dependencies": {
"@babel/core": "^7.5.5",
"@babel/plugin-external-helpers": "^7.2.0",
"@babel/plugin-transform-modules-umd": "^7.2.0",
"@babel/preset-env": "^7.5.5"
"@babel/core": "^7.18.5",
"@babel/plugin-external-helpers": "^7.17.12",
"@babel/plugin-transform-modules-umd": "^7.18.0",
"@babel/preset-env": "^7.18.2"
},
"devDependencies": {
"eslint": "^3.19.0",
Expand Down
4 changes: 2 additions & 2 deletions solr/conf/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@
</analyzer>
</fieldType>

<!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
<!-- A specialized field for geospatial search filters and distance sorting. -->
<fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true" />

<fieldType name="_nest_path_" class="solr.NestPathField" />

Expand Down
1 change: 1 addition & 0 deletions solr/conf/solrconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
-->
<luceneMatchVersion>8.2.0</luceneMatchVersion>

<lib dir="${solr.install.dir:../../../..}/modules/analysis-extras/lib" />
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

context 'a configured field' do
it 'returns the configuration class for the given field' do
expect(factory.field_config).to be_a Blacklight::Configuration::SummaryField
expect(factory.field_config).to be_a Blacklight::Configuration::Field
expect(factory.field_config.separator_options).to eq(words_connector: '; ')
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/test_app_templates/Gemfile.extra
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gem 'blacklight_range_limit', '~> 7.1'
gem 'autoprefixer-rails', '~> 10.2.5'
gem 'execjs', '< 2.8.0'
gem 'blacklight_range_limit', '>= 7.1'
gem 'autoprefixer-rails', '~> 10.2'
gem 'execjs'
2 changes: 1 addition & 1 deletion spec/views/_requests.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper'

RSpec.describe 'arclight/_requests.html.erb', type: :view do
RSpec.describe 'arclight/_requests', type: :view do
let(:document) { SolrDocument.new(id: 'abc123') }
let(:config) { instance_double(Arclight::Repository) }
let(:blacklight_config) { Blacklight::Configuration.new }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper'

RSpec.describe 'catalog/_within_collection_dropdown.html.erb', type: :view do
RSpec.describe 'catalog/_within_collection_dropdown', type: :view do
before do
allow(view).to receive(:within_collection_context?).and_return(within_collection_context?)
render
Expand Down

0 comments on commit b224ab5

Please sign in to comment.