blacklight-ris 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -3
- data/app/helpers/blacklight_ris_helper.rb +2 -2
- data/app/models/concerns/blacklight/{solr/document/ris_export.rb → ris/document_export.rb} +1 -1
- data/app/models/concerns/blacklight/{solr/document/ris_fields.rb → ris/document_fields.rb} +1 -1
- data/app/views/bookmarks/index.ris.erb +1 -1
- data/config/locales/blacklight_ris.en.yml +4 -0
- data/lib/blacklight/ris/catalog.rb +2 -2
- data/lib/blacklight/ris/engine.rb +5 -5
- data/lib/blacklight/ris/version.rb +1 -1
- data/lib/blacklight/ris.rb +0 -1
- metadata +27 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 766b87436551db677308e36aa3d7072cf32fb920138c122eec5dc0f057f8653f
|
4
|
+
data.tar.gz: c87605786248978a39241e79e884fcce87064a17e3021ac411bbb5add59d7605
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c1cf6b40fd2f4a94794adcbf8b779c2b7ba3586f60a01e4b8c1237ec5597e2f832166ed7a33fb926d9a7d770bc373412b3703f5322439a368979780090331cb
|
7
|
+
data.tar.gz: 4de92f5f0fb2a7c7a1d540b8465b1dfdeefc2822e17f543447436c9edb068a12ef7b10ba5bc51cb00de2b99014493269dbf42e3ac79ace4d4d7a94f52dac7445
|
data/README.md
CHANGED
@@ -8,12 +8,14 @@ Blacklight plugin that adds the ability to download a [RIS representation](https
|
|
8
8
|
### Versioning
|
9
9
|
`v0.1.0` -> Known to work with Blacklight v6 and Rails 4
|
10
10
|
|
11
|
+
`v0.2.0` -> Known to work with Blacklight v8 and Rails 7 (untested with Blacklight v7 but might work)
|
12
|
+
|
11
13
|
## Installation
|
12
14
|
|
13
15
|
Add this line to your application's Gemfile:
|
14
16
|
|
15
17
|
```ruby
|
16
|
-
gem 'blacklight-ris'
|
18
|
+
gem 'blacklight-ris'
|
17
19
|
```
|
18
20
|
|
19
21
|
And then execute:
|
@@ -31,8 +33,8 @@ class SolrDocument
|
|
31
33
|
|
32
34
|
# ...existing code...
|
33
35
|
|
34
|
-
include Blacklight::
|
35
|
-
use_extension(Blacklight::
|
36
|
+
include Blacklight::Ris::DocumentFields
|
37
|
+
use_extension(Blacklight::Ris:DocumentExport)
|
36
38
|
|
37
39
|
ris_field_mappings.merge!(
|
38
40
|
# Procs are evaluated in context of SolrDocument instance
|
@@ -4,9 +4,9 @@ module BlacklightRisHelper
|
|
4
4
|
# this helper is called from the Show view and Bookmarks view
|
5
5
|
def ris_path(opts = {})
|
6
6
|
if controller_name == "bookmarks"
|
7
|
-
bookmarks_path(
|
7
|
+
bookmarks_path(format: 'ris')
|
8
8
|
else
|
9
|
-
solr_document_path(
|
9
|
+
solr_document_path(format: 'ris')
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -1 +1 @@
|
|
1
|
-
<%= render_ris(@
|
1
|
+
<%= render_ris(@response.documents) %>
|
@@ -7,13 +7,13 @@ module Blacklight::Ris
|
|
7
7
|
|
8
8
|
included do
|
9
9
|
# this also causes Blacklight's show endpoint to handle .ris
|
10
|
-
add_show_tools_partial(:ris, label: '
|
10
|
+
blacklight_config.add_show_tools_partial(:ris, label: I18n.t('blacklight.tools.ris'), if: :render_ris_action?, modal: false, path: :ris_path)
|
11
11
|
end
|
12
12
|
|
13
13
|
private
|
14
14
|
|
15
15
|
def render_ris_action? config, options = {}
|
16
|
-
doc = options[:document] || (
|
16
|
+
doc = options[:document] || (@response.documents || []).first
|
17
17
|
doc && doc.respond_to?(:export_formats) && doc.export_formats.keys.include?(:ris )
|
18
18
|
end
|
19
19
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
|
2
|
+
module Blacklight::Ris
|
3
3
|
class Engine < ::Rails::Engine
|
4
4
|
isolate_namespace Blacklight::Ris
|
5
5
|
|
@@ -8,9 +8,9 @@ module Blacklight
|
|
8
8
|
end
|
9
9
|
|
10
10
|
initializer 'blacklight-ris.helpers' do |app|
|
11
|
-
|
11
|
+
config.after_initialize do
|
12
|
+
ActionView::Base.include BlacklightRisHelper
|
13
|
+
end
|
12
14
|
end
|
13
|
-
|
14
15
|
end
|
15
|
-
end
|
16
16
|
end
|
data/lib/blacklight/ris.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight-ris
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Chiu
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '7'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: blacklight
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '7'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '7'
|
27
41
|
description: RIS format export for Blacklight
|
28
42
|
email:
|
29
43
|
- jeffchiu@upenn.edu
|
@@ -35,9 +49,10 @@ files:
|
|
35
49
|
- README.md
|
36
50
|
- Rakefile
|
37
51
|
- app/helpers/blacklight_ris_helper.rb
|
38
|
-
- app/models/concerns/blacklight/
|
39
|
-
- app/models/concerns/blacklight/
|
52
|
+
- app/models/concerns/blacklight/ris/document_export.rb
|
53
|
+
- app/models/concerns/blacklight/ris/document_fields.rb
|
40
54
|
- app/views/bookmarks/index.ris.erb
|
55
|
+
- config/locales/blacklight_ris.en.yml
|
41
56
|
- config/routes.rb
|
42
57
|
- lib/blacklight/ris.rb
|
43
58
|
- lib/blacklight/ris/catalog.rb
|
@@ -49,7 +64,7 @@ licenses:
|
|
49
64
|
- MIT
|
50
65
|
metadata:
|
51
66
|
rubygems_mfa_required: 'false'
|
52
|
-
post_install_message:
|
67
|
+
post_install_message:
|
53
68
|
rdoc_options: []
|
54
69
|
require_paths:
|
55
70
|
- lib
|
@@ -64,8 +79,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
79
|
- !ruby/object:Gem::Version
|
65
80
|
version: '0'
|
66
81
|
requirements: []
|
67
|
-
rubygems_version: 3.
|
68
|
-
signing_key:
|
82
|
+
rubygems_version: 3.4.10
|
83
|
+
signing_key:
|
69
84
|
specification_version: 4
|
70
85
|
summary: RIS format export for Blacklight
|
71
86
|
test_files: []
|