blacklight-ris 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a8d3a0519f3934e4ebddfdee72cc123c323bc0ec8085223d81cf093f4cd9f1b
4
- data.tar.gz: 87422585dffe4625444aa94964cc54bd8e63431a560c20fb3bc2d33befdae2cf
3
+ metadata.gz: 766b87436551db677308e36aa3d7072cf32fb920138c122eec5dc0f057f8653f
4
+ data.tar.gz: c87605786248978a39241e79e884fcce87064a17e3021ac411bbb5add59d7605
5
5
  SHA512:
6
- metadata.gz: 5608cfed0c79ae83532160aeeb67191ad6c55f7dd2b6fc7700965b191d8824076c31a062acc91b9bd7de1497f3b78a9be9d3bce7c270051090faad4773f8d332
7
- data.tar.gz: 0ab726f67034f0465017cc5c9f20a35424c16e5dd7068e43b7dacd0f49690bc225630748e3706d1d05b4fa6d5b11705a057c81a8503e7144433ca3d04210b949
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', '0.1.0'
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::Solr::Document::RisFields
35
- use_extension(Blacklight::Solr::Document::RisExport)
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(opts.merge(format: 'ris'))
7
+ bookmarks_path(format: 'ris')
8
8
  else
9
- solr_document_path(opts.merge(format: 'ris'))
9
+ solr_document_path(format: 'ris')
10
10
  end
11
11
  end
12
12
 
@@ -1,5 +1,5 @@
1
1
 
2
- module Blacklight::Solr::Document::RisExport
2
+ module Blacklight::Ris::DocumentExport
3
3
 
4
4
  def self.extended(document)
5
5
  document.will_export_as(:ris, 'application/x-research-info-systems')
@@ -1,5 +1,5 @@
1
1
 
2
- module Blacklight::Solr::Document::RisFields
2
+ module Blacklight::Ris::DocumentFields
3
3
 
4
4
  extend ActiveSupport::Concern
5
5
 
@@ -1 +1 @@
1
- <%= render_ris(@document_list) %>
1
+ <%= render_ris(@response.documents) %>
@@ -0,0 +1,4 @@
1
+ en:
2
+ blacklight:
3
+ tools:
4
+ ris: 'Download in RIS format'
@@ -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: 'Download in RIS format', if: :render_ris_action?, modal: false, path: :ris_path)
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] || (options[:document_list] || []).first
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
- module Blacklight
2
- module Ris
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
- ActionView::Base.send :include, BlacklightRisHelper
11
+ config.after_initialize do
12
+ ActionView::Base.include BlacklightRisHelper
13
+ end
12
14
  end
13
-
14
15
  end
15
- end
16
16
  end
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Ris
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
@@ -1,4 +1,3 @@
1
-
2
1
  require 'blacklight/ris/engine'
3
2
 
4
3
  module Blacklight
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.1.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-07-23 00:00:00.000000000 Z
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: '4.2'
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: '4.2'
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/solr/document/ris_export.rb
39
- - app/models/concerns/blacklight/solr/document/ris_fields.rb
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.0.3.1
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: []