Skip to content

Commit

Permalink
Merge pull request #88 from projectblacklight/rails6
Browse files Browse the repository at this point in the history
Update the gem for Rails 6
  • Loading branch information
mejackreed committed Aug 4, 2020
2 parents c0ff1d9 + 55c8d60 commit 42ac7fb
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 35 deletions.
16 changes: 10 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ sudo: false
notifications:
email: false

rvm:
- 2.3.4
- 2.4.4
- 2.5.1
matrix:
include:
- rvm: 2.7.1
env: "RAILS_VERSION=6.0.3.2"
- rvm: 2.6.6
env: "RAILS_VERSION=6.0.3.2"
- rvm: 2.6.6
env: "RAILS_VERSION=5.2.4.3"

before_install:
- gem install bundler
Expand All @@ -19,5 +23,5 @@ notifications:

global_env:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
jdk: oraclejdk8

jdk: openjdk11
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ else
end

case ENV['RAILS_VERSION']
when /^6.0/
gem 'sass-rails', '>= 6'
gem 'webpacker', '~> 4.0'
when /^5.[12]/
gem 'sass-rails', '~> 5.0'
when /^4.2/
gem 'responders', '~> 2.0'
gem 'sass-rails', '>= 5.0'
Expand Down
6 changes: 3 additions & 3 deletions app/helpers/blacklight_marc_helper.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module BlacklightMarcHelper

# This method should move to BlacklightMarc in Blacklight 6.x
def refworks_export_url params = {}
def refworks_export_url params = {}, *_
"http://www.refworks.com/express/expressimport.asp?vendor=#{CGI.escape(params[:vendor] || application_name)}&filter=#{CGI.escape(params[:filter] || "MARC Format")}&encoding=65001" + (("&url=#{CGI.escape(params[:url])}" if params[:url]) || "")
end

def refworks_solr_document_path opts = {}
def refworks_solr_document_path opts = {}, *_
if opts[:id]
refworks_export_url(url: solr_document_url(opts[:id], format: :refworks_marc_txt))
end
end

# For exporting a single endnote document. (endnote_catalog_path is defined by blacklight-marc and it is used for multiple document export)
def single_endnote_catalog_path opts = {}
def single_endnote_catalog_path opts = {}, *_
solr_document_path(opts.merge(format: 'endnote'))
end

Expand Down
5 changes: 2 additions & 3 deletions blacklight-marc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ Gem::Specification.new do |spec|
spec.add_dependency "traject", "~>3.0"
spec.add_dependency 'marc-fastxmlwriter' # NO REXML

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec-rails", '~> 3.0'
spec.add_development_dependency "rspec-rails", '~> 4.0'
spec.add_development_dependency "rspec-activemodel-mocks"
spec.add_development_dependency "solr_wrapper"
spec.add_development_dependency "capybara"
spec.add_development_dependency "coveralls"
spec.add_development_dependency "simplecov"
spec.add_development_dependency "engine_cart", "~> 2.0"
end
2 changes: 2 additions & 0 deletions lib/blacklight/marc/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class Engine < Rails::Engine
end

initializer 'blacklight_marc.initialize' do |app|
require 'blacklight/solr/document'

Mime::Type.register_alias "text/plain", :refworks_marc_txt
Mime::Type.register_alias "text/plain", :openurl_kev
Mime::Type.register "application/x-endnote-refer", :endnote
Expand Down
42 changes: 20 additions & 22 deletions solr/conf/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<dynamicField name="*_isi" type="int" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_isim" type="int" stored="true" indexed="true" multiValued="true"/>

<!-- trie integer (_it...) (for faster range queries) -->
<!-- IntegerPointField (_it...) (for faster range queries) -->

<dynamicField name="*_iti" type="tint" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_itim" type="tint" stored="false" indexed="true" multiValued="true"/>
Expand All @@ -93,7 +93,7 @@
<dynamicField name="*_dtsi" type="date" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_dtsim" type="date" stored="true" indexed="true" multiValued="true"/>

<!-- trie date (_dtt...) (for faster range queries) -->
<!-- DatePointField (_dtt...) (for faster range queries) -->

<dynamicField name="*_dtti" type="tdate" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_dttim" type="tdate" stored="false" indexed="true" multiValued="true"/>
Expand All @@ -113,7 +113,7 @@
<dynamicField name="*_lsi" type="long" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_lsim" type="long" stored="true" indexed="true" multiValued="true"/>

<!-- trie long (_lt...) (for faster range queries) -->
<!-- LongPointField (_lt...) (for faster range queries) -->

<dynamicField name="*_lti" type="tlong" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_ltim" type="tlong" stored="false" indexed="true" multiValued="true"/>
Expand All @@ -133,7 +133,7 @@
<dynamicField name="*_dbsi" type="double" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_dbsim" type="double" stored="true" indexed="true" multiValued="true"/>

<!-- trie double (_dbt...) (for faster range queries) -->
<!-- DoublePointField (_dbt...) (for faster range queries) -->

<dynamicField name="*_dbti" type="tdouble" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_dbtim" type="tdouble" stored="false" indexed="true" multiValued="true"/>
Expand All @@ -153,7 +153,7 @@
<dynamicField name="*_fsi" type="float" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_fsim" type="float" stored="true" indexed="true" multiValued="true"/>

<!-- trie float (_ft...) (for faster range queries) -->
<!-- FloatPointField (_ft...) (for faster range queries) -->

<dynamicField name="*_fti" type="tfloat" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_ftim" type="tfloat" stored="false" indexed="true" multiValued="true"/>
Expand Down Expand Up @@ -231,23 +231,23 @@
<fieldType name="rand" class="solr.RandomSortField" omitNorms="true"/>

<!-- Default numeric field types. -->
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="int" class="solr.IntPointField" docValues="true"/>
<fieldType name="float" class="solr.FloatPointField" docValues="true"/>
<fieldType name="long" class="solr.LongPointField" docValues="true"/>
<fieldType name="double" class="solr.DoublePointField" docValues="true"/>

<!-- trie numeric field types for faster range queries -->
<fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
<fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>
<fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>
<fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>
<!-- PointField numeric field types for faster range queries -->
<fieldType name="tint" class="solr.IntPointField" docValues="true"/>
<fieldType name="tfloat" class="solr.FloatPointField" docValues="true"/>
<fieldType name="tlong" class="solr.LongPointField" docValues="true"/>
<fieldType name="tdouble" class="solr.DoublePointField" docValues="true"/>

<!-- The format for this date field is of the form 1995-12-31T23:59:59Z
Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
-->
<fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
<!-- A Trie based date field for faster date range queries and date faceting. -->
<fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>
<fieldType name="date" class="solr.DatePointField" docValues="true"/>
<!-- A PointField based date field for faster date range queries and date faceting. -->
<fieldType name="tdate" class="solr.DatePointField" docValues="true"/>


<!-- This point type indexes the coordinates as separate fields (subFields)
Expand All @@ -263,8 +263,8 @@
-->
<fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>

<!-- 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"/>

<!-- An alternative geospatial field type new to Solr 4. It supports multiValued and polygon shapes.
For more information about this and other Spatial fields new to Solr 4, see:
Expand All @@ -276,7 +276,7 @@
<field name="bbox" type="bbox" />
<fieldType name="bbox" class="solr.BBoxField"
geo="true" distanceUnits="kilometers" numberType="_bbox_coord" storeSubFields="false"/>
<fieldType name="_bbox_coord" class="solr.TrieDoubleField" precisionStep="8" docValues="true" stored="false"/>
<fieldType name="_bbox_coord" class="solr.DoublePointField" docValues="true" stored="false"/>

<fieldType name="text" class="solr.TextField" omitNorms="false">
<analyzer>
Expand Down Expand Up @@ -350,7 +350,6 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
Expand All @@ -359,7 +358,6 @@
<fieldType name="textSuggest" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
describe "#librarian_view" do
it "is successful" do
get :librarian_view, params: { id: '86207417' }
expect(response).to be_success
expect(response).to be_successful
end
end
end

0 comments on commit 42ac7fb

Please sign in to comment.