blacklight-marc 8.1.1 → 8.1.3

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: 483538c623aaace602da20c35e7b3fc349ac18e06ffe4277ac9a14f14eff237e
4
- data.tar.gz: cfbc11131199f2895db722e609a23dfa4cec8be8e27781f542076931988aaf5c
3
+ metadata.gz: 892b3e164a4e741d7cefba50dfc8a2193edf2b0a7bc66adf05a5c4e58e1c482e
4
+ data.tar.gz: cf42c3ae6f2e43c46a2d111d2f057f31cfae5a7c21df216744a83230ef0b588c
5
5
  SHA512:
6
- metadata.gz: bc6f9437f9c3a53fe810cf7f1fe1a831e7d6c1de22e9ab04927a0702163e4ef474c4868f322ce8bf2374a4a36fd4354a748a26788001e73b46bbe7dd8e85fe9d
7
- data.tar.gz: 41943dec1aef4930cfb7ee783dadb6ba63d097882486547f292bb14c2e1f088685f17080a60483f2f08080878ebd61020d48a4ca739a1d0b247ee6f00ad270e6
6
+ metadata.gz: 610b71ad440c2bef34899c5d1463b1de5559e169dc0d620948852dd0d54ed1c99213cfdabcf21616b94c95c9b0a0206a92f231ae6df31eb6c85b1f4b03ba68a3
7
+ data.tar.gz: 46c85f6dc456b7151a06d800c3a841246e5e46b0acc705e0201b307fbf77121a8926ee1a9df60435c0f21d0d489d4749937fa61def7daccbe4764c57c9c8dd27
data/Gemfile CHANGED
@@ -9,8 +9,8 @@ end
9
9
  gemspec path: File.expand_path('..', __FILE__)
10
10
 
11
11
  # BEGIN ENGINE_CART BLOCK
12
- # engine_cart: 1.0.1
13
- # engine_cart stanza: 0.10.0
12
+ # engine_cart: 2.6.0
13
+ # engine_cart stanza: 2.5.0
14
14
  # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
15
15
  file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
16
16
  if File.exist?(file)
@@ -30,20 +30,16 @@ else
30
30
  else
31
31
  gem 'rails', ENV['RAILS_VERSION']
32
32
  end
33
- end
34
33
 
35
- case ENV['RAILS_VERSION']
36
- when /^6.0/
37
- gem 'sass-rails', '>= 6'
38
- gem 'webpacker', '~> 4.0'
39
- when /^5.[12]/
40
- gem 'sass-rails', '~> 5.0'
41
- when /^4.2/
42
- gem 'responders', '~> 2.0'
43
- gem 'sass-rails', '>= 5.0'
44
- gem 'coffee-rails', '~> 4.1.0'
45
- when /^4.[01]/
46
- gem 'sass-rails', '< 5.0'
34
+ case ENV['RAILS_VERSION']
35
+ when /^6.0/
36
+ gem 'sass-rails', '>= 6'
37
+ gem 'webpacker', '~> 4.0'
38
+ when /^5.[12]/
39
+ gem 'sass-rails', '~> 5.0'
40
+ gem 'sprockets', '~> 3.7'
41
+ gem 'thor', '~> 0.20'
42
+ end
47
43
  end
48
44
  end
49
45
  # END ENGINE_CART BLOCK
@@ -1,8 +1,6 @@
1
1
  module BlacklightMarcHelper
2
-
3
- # This method should move to BlacklightMarc in Blacklight 6.x
4
2
  def refworks_export_url params = {}, *_
5
- "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]) || "")
3
+ "https://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]) || "")
6
4
  end
7
5
 
8
6
  def refworks_solr_document_path opts = {}, *_
@@ -561,6 +561,7 @@ module Blacklight::Marc::DocumentExport
561
561
 
562
562
  def abbreviate_name(name)
563
563
  name_parts = name.split(", ")
564
+ return "" if name_parts.empty?
564
565
  first_name_parts = name_parts.last.split(" ")
565
566
  temp_name = name_parts.first + ", " + first_name_parts.first[0,1] + "."
566
567
  first_name_parts.shift
@@ -570,7 +571,7 @@ module Blacklight::Marc::DocumentExport
570
571
 
571
572
  def name_reverse(name)
572
573
  name = clean_end_punctuation(name)
573
- return name unless name =~ /,/
574
+ return name if name == ", " || !(name =~ /,/)
574
575
  temp_name = name.split(", ")
575
576
  return temp_name.last + " " + temp_name.first
576
577
  end
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Marc
3
- VERSION = '8.1.1'
3
+ VERSION = '8.1.3'
4
4
  end
5
5
  end
@@ -26,6 +26,19 @@ class MockClass264
26
26
  end
27
27
  end
28
28
 
29
+ class MockClassInvalid700
30
+ include Blacklight::Marc::DocumentExport
31
+
32
+ def to_marc
33
+ fields = [
34
+ { "100" => { "subfields" => [{ "a" => "Borja, Ronaldo I." }]}},
35
+ { "245" => { "ind1" => " ", "ind2" => " ", "subfields" => [{ "a" => "Plasticity : ", "b" => "modeling & computation /", "c" => "Ronaldo I. Borja." }] } },
36
+ { "700" => { "ind1" => " ", "ind2" => " ", "subfields" => [{ "a" => ", ." }] } }
37
+ ]
38
+ MARC::Record.new_from_hash('fields' => fields)
39
+ end
40
+ end
41
+
29
42
  RSpec.describe Blacklight::Marc::DocumentExport do
30
43
  describe 'export citiations from 260 field' do
31
44
  it 'exports citations in apa format' do
@@ -60,4 +73,21 @@ RSpec.describe Blacklight::Marc::DocumentExport do
60
73
  expect(MockClass264.new.export_as_chicago_citation_txt).to include('Berlin: Springer,')
61
74
  end
62
75
  end
76
+
77
+ describe 'when the 700 only has punctuation and spaces' do
78
+ it 'exports citations in apa format' do
79
+ expect(MockClassInvalid700.new.export_as_apa_citation_txt).to include('Borja, R. I')
80
+ expect(MockClassInvalid700.new.export_as_apa_citation_txt).to include('Plasticity')
81
+ end
82
+
83
+ it 'exports citations in mla format' do
84
+ expect(MockClassInvalid700.new.export_as_mla_citation_txt).to include('Borja, Ronaldo I')
85
+ expect(MockClassInvalid700.new.export_as_mla_citation_txt).to include('Plasticity')
86
+ end
87
+
88
+ it 'exports citations in Chicago format' do
89
+ expect(MockClassInvalid700.new.export_as_chicago_citation_txt).to include('Borja, Ronaldo I')
90
+ expect(MockClassInvalid700.new.export_as_chicago_citation_txt).to include('Plasticity')
91
+ end
92
+ end
63
93
  end
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: 8.1.1
4
+ version: 8.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-05 00:00:00.000000000 Z
11
+ date: 2024-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blacklight
@@ -331,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
331
331
  - !ruby/object:Gem::Version
332
332
  version: '0'
333
333
  requirements: []
334
- rubygems_version: 3.5.4
334
+ rubygems_version: 3.5.6
335
335
  signing_key:
336
336
  specification_version: 4
337
337
  summary: MARC support for Blacklight