blacklight-marc 7.1.1 → 7.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +7 -20
- data/app/models/concerns/blacklight/{solr/document/marc_export.rb → marc/document_export.rb} +3 -2
- data/app/models/concerns/blacklight/{solr/document/marc.rb → marc/document_extension.rb} +6 -4
- data/lib/blacklight/marc/engine.rb +7 -11
- data/lib/blacklight/marc/version.rb +1 -1
- data/lib/generators/blacklight/marc/install_generator.rb +4 -4
- data/spec/test_app_templates/Gemfile.extra +0 -1
- data/spec/views/bookmarks/_endnote.html.erb_spec.rb +1 -1
- data/spec/views/bookmarks/_refworks.html.erb_spec.rb +1 -1
- data/spec/views/catalog/index.atom.builder_spec.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c370b1c69a4ed2a7c2e77de6dbdeedbf6314fa1334ae1c3f88f216bd7dad23a
|
4
|
+
data.tar.gz: cf92a4865a958b67d9f9eec4f352e5cc666f5b1c052661d2e1d0899ce1e45419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54ddf02511c8fa185842d66f0f1f30a9ae988485fc0108e7f099fc6b4a8b4be83b56f96c6757949d7b3c95b9e1444fb08c219e68c3c5d2c1a81c560d092848e8
|
7
|
+
data.tar.gz: f1d1c86c9635a4519c898763d7a6fc80a05088a3060c4dd41dae28d2b7b763806cd3f577094d9d69f4760a9dbbf26944ac47bf92ef6181c144e96711d8acff1c
|
data/.github/workflows/ruby.yml
CHANGED
@@ -11,26 +11,13 @@ jobs:
|
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
strategy:
|
13
13
|
matrix:
|
14
|
-
rails_version: [6.1.
|
15
|
-
ruby: [2.7, 3.0]
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
uses: ruby/setup-ruby@v1
|
22
|
-
with:
|
23
|
-
ruby-version: ${{ matrix.ruby }}
|
24
|
-
- name: Install dependencies with Rails ${{ matrix.rails_version }}
|
25
|
-
run: bundle install
|
26
|
-
- name: Run tests
|
27
|
-
run: bundle exec rake
|
28
|
-
test_rails52:
|
29
|
-
runs-on: ubuntu-latest
|
30
|
-
strategy:
|
31
|
-
matrix:
|
32
|
-
rails_version: [5.2.4.4, 6.0.3.4]
|
33
|
-
ruby: [2.7]
|
14
|
+
rails_version: [6.1.4.7, 7.0.2.3]
|
15
|
+
ruby: [2.7, '3.0']
|
16
|
+
include:
|
17
|
+
- rails_version: 5.2.4.4
|
18
|
+
ruby: 2.7
|
19
|
+
- rails_version: 6.0.3.4
|
20
|
+
ruby: 2.7
|
34
21
|
env:
|
35
22
|
RAILS_VERSION: ${{ matrix.rails_version }}
|
36
23
|
steps:
|
data/app/models/concerns/blacklight/{solr/document/marc_export.rb → marc/document_export.rb}
RENAMED
@@ -1,11 +1,12 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
# -*- coding: utf-8 -*-
|
3
|
-
|
3
|
+
|
4
|
+
# Written for use with Blacklight::Marc::DocumentExtension, but you can use
|
4
5
|
# it for your own custom Blacklight document Marc extension too -- just
|
5
6
|
# include this module in any document extension (or any other class)
|
6
7
|
# that provides a #to_marc returning a ruby-marc object. This module will add
|
7
8
|
# in export_as translation methods for a variety of formats.
|
8
|
-
module Blacklight::
|
9
|
+
module Blacklight::Marc::DocumentExport
|
9
10
|
|
10
11
|
def self.register_export_formats(document)
|
11
12
|
document.will_export_as(:xml)
|
@@ -9,7 +9,7 @@
|
|
9
9
|
# This extension would normally be registered using
|
10
10
|
# Blacklight::Solr::Document#use_extension. eg:
|
11
11
|
#
|
12
|
-
# SolrDocument.use_extension( Blacklight::
|
12
|
+
# SolrDocument.use_extension( Blacklight::Marc::DocumentExtension ) { |document| my_logic_for_document_has_marc?( document ) }
|
13
13
|
#
|
14
14
|
# This extension also expects a :marc_source_field and :marc_format_type to
|
15
15
|
# be registered with the hosting classes extension_parameters. In an initializer
|
@@ -18,15 +18,16 @@
|
|
18
18
|
# SolrDocument.extension_parameters[:marc_format_type] = :marc21 # or :marcxml
|
19
19
|
require 'marc'
|
20
20
|
|
21
|
-
module Blacklight::
|
21
|
+
module Blacklight::Marc
|
22
|
+
module DocumentExtension
|
22
23
|
|
23
|
-
include Blacklight::
|
24
|
+
include Blacklight::Marc::DocumentExport # All our export_as stuff based on to_marc.
|
24
25
|
|
25
26
|
class UnsupportedMarcFormatType < RuntimeError; end
|
26
27
|
|
27
28
|
def self.extended(document)
|
28
29
|
# Register our exportable formats, we inherit these from MarcExport
|
29
|
-
Blacklight::
|
30
|
+
Blacklight::Marc::DocumentExport.register_export_formats( document )
|
30
31
|
end
|
31
32
|
|
32
33
|
# ruby-marc object
|
@@ -78,4 +79,5 @@ module Blacklight::Solr::Document::Marc
|
|
78
79
|
self.class.extension_parameters[:marc_format_type]
|
79
80
|
end
|
80
81
|
|
82
|
+
end
|
81
83
|
end
|
@@ -1,21 +1,10 @@
|
|
1
|
-
require "blacklight/marc"
|
2
|
-
require "rails"
|
3
|
-
|
4
1
|
module Blacklight::Marc
|
5
2
|
class Engine < Rails::Engine
|
6
|
-
config.autoload_paths += %W(
|
7
|
-
#{config.root}/app/presenters
|
8
|
-
#{config.root}/app/controllers/concerns
|
9
|
-
#{config.root}/app/models/concerns
|
10
|
-
)
|
11
|
-
|
12
3
|
rake_tasks do
|
13
4
|
load "railties/solr_marc.rake"
|
14
5
|
end
|
15
6
|
|
16
7
|
initializer 'blacklight_marc.initialize' do |app|
|
17
|
-
require 'blacklight/solr/document'
|
18
|
-
|
19
8
|
Mime::Type.register_alias "text/plain", :refworks_marc_txt
|
20
9
|
Mime::Type.register_alias "text/plain", :openurl_kev
|
21
10
|
Mime::Type.register "application/x-endnote-refer", :endnote
|
@@ -23,6 +12,13 @@ module Blacklight::Marc
|
|
23
12
|
Mime::Type.register "application/marcxml+xml", :marcxml,
|
24
13
|
["application/x-marc+xml", "application/x-marcxml+xml",
|
25
14
|
"application/marc+xml"]
|
15
|
+
|
16
|
+
# these are here for backwards compatibility with the old class names,
|
17
|
+
# which zeitwerk didn't care for
|
18
|
+
config.after_initialize do
|
19
|
+
Blacklight::Solr::Document::Marc = Blacklight::Marc::DocumentExtension
|
20
|
+
Blacklight::Solr::Document::MarcExport = Blacklight::Marc::DocumentExport
|
21
|
+
end
|
26
22
|
end
|
27
23
|
end
|
28
24
|
end
|
@@ -40,11 +40,11 @@ EOF
|
|
40
40
|
# The following shows how to setup this blacklight document to display marc documents
|
41
41
|
extension_parameters[:marc_source_field] = :marc_ss
|
42
42
|
extension_parameters[:marc_format_type] = :marcxml
|
43
|
-
use_extension(
|
44
|
-
document.key?(
|
43
|
+
use_extension(Blacklight::Marc::DocumentExtension) do |document|
|
44
|
+
document.key?(SolrDocument.extension_parameters[:marc_source_field])
|
45
45
|
end
|
46
|
-
|
47
|
-
field_semantics.merge!(
|
46
|
+
|
47
|
+
field_semantics.merge!(
|
48
48
|
:title => "title_ssm",
|
49
49
|
:author => "author_ssm",
|
50
50
|
:language => "language_ssim",
|
@@ -29,7 +29,7 @@ describe "catalog/index" do
|
|
29
29
|
params.merge!( @params )
|
30
30
|
allow(view).to receive(:blacklight_config).and_return(@config)
|
31
31
|
allow(view).to receive(:search_field_options_for_select).and_return([])
|
32
|
-
|
32
|
+
allow(controller).to receive(:search_state_class).and_return(Blacklight::SearchState)
|
33
33
|
render :template => 'catalog/index', :formats => [:atom]
|
34
34
|
|
35
35
|
# We need to use rexml to test certain things that have_tag wont' test
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight-marc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|
@@ -228,8 +228,8 @@ files:
|
|
228
228
|
- Rakefile
|
229
229
|
- app/assets/stylesheets/blacklight_marc.scss
|
230
230
|
- app/helpers/blacklight_marc_helper.rb
|
231
|
-
- app/models/concerns/blacklight/
|
232
|
-
- app/models/concerns/blacklight/
|
231
|
+
- app/models/concerns/blacklight/marc/document_export.rb
|
232
|
+
- app/models/concerns/blacklight/marc/document_extension.rb
|
233
233
|
- app/views/bookmarks/_endnote.html.erb
|
234
234
|
- app/views/bookmarks/_marc_tools.html.erb
|
235
235
|
- app/views/bookmarks/_refworks.html.erb
|
@@ -325,7 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
325
325
|
- !ruby/object:Gem::Version
|
326
326
|
version: '0'
|
327
327
|
requirements: []
|
328
|
-
rubygems_version: 3.2.
|
328
|
+
rubygems_version: 3.2.32
|
329
329
|
signing_key:
|
330
330
|
specification_version: 4
|
331
331
|
summary: MARC support for Blacklight
|