blacklight-marc 8.1.1 → 8.1.2
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ddc8931784772b5088a18b2d969c2039cff9e0897785a0b40094ef6acbb35135
|
|
4
|
+
data.tar.gz: 8ad3d91c571774c588ccc2d94d74220c5685117544dabd5b18c3954efec8cc05
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2f7f6a477a2851319cc6922086e384156c2e0389c62052b77c4779d42012746c0608250b0fcb27d33f6ab7f61ab9591bf00258cec3b3d308a8905cf17c76864e
|
|
7
|
+
data.tar.gz: a9ce0202761b05216a1d31b3e5a95cf6034f7d3c9667937cc129a7fa6867eb1f4fb930a4cc72ae87432c850bea42e7553d9fac127d56a9ad6e78611ca77f7cb7
|
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:
|
|
13
|
-
# engine_cart stanza:
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
@@ -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
|
|
574
|
+
return name if name == ", " || !(name =~ /,/)
|
|
574
575
|
temp_name = name.split(", ")
|
|
575
576
|
return temp_name.last + " " + temp_name.first
|
|
576
577
|
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.
|
|
4
|
+
version: 8.1.2
|
|
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-
|
|
11
|
+
date: 2024-03-08 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.
|
|
334
|
+
rubygems_version: 3.3.3
|
|
335
335
|
signing_key:
|
|
336
336
|
specification_version: 4
|
|
337
337
|
summary: MARC support for Blacklight
|