stanford-mods 1.0.2 → 1.0.3
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.rdoc +1 -0
- data/lib/stanford-mods/searchworks.rb +1 -1
- data/lib/stanford-mods/version.rb +1 -1
- data/spec/searchworks_format_spec.rb +24 -24
- metadata +19 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d5012f113350896de50bcb147a50b21177ad523
|
4
|
+
data.tar.gz: 3a91ab13a3c35c0ebd9a93ff3512285c13986a1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85c0b6bdd15c6e9a09f567164e9aacd9d3555930b228b4270b8ba72d8d90bc9e970c9f7aaecf4c1484daa0de53207dee885fd0f72b7ecac96239d784e0f58e2b
|
7
|
+
data.tar.gz: 96159a0d40c32c5c63f994622514f09c742d33740667dee36eace14e0b68e0857d0514c123ed58baa8c0d2938edecfd62373153a8b2e4d8ae82757541ef37fac
|
data/README.rdoc
CHANGED
@@ -59,6 +59,7 @@ Example Using SearchWorks Mixins:
|
|
59
59
|
6. Create new Pull Request
|
60
60
|
|
61
61
|
== Releases
|
62
|
+
* <b>1.0.3</b> format_main value 'Article' is now 'Book'
|
62
63
|
* <b>1.0.2</b> add format_main and sw_genre tests to searchworks.rb
|
63
64
|
* <b>1.0.1</b> sw_title_display keeps appropriate trailing punct more or less per spec in solrmarc-sw sw_index.properties
|
64
65
|
* <b>1.0.0</b> sw_full_title now includes partName and partNumber; sw_title_display created to be like sw_full_title but without trailing punctuation; sw format for typeOfResource sound recording; genre value is librettos, plural; sw format algorithm accommodates first letter upcase; genre value report does NOT map to a format, genre value 'project report' with ToR text is 'Book'
|
@@ -619,7 +619,7 @@ module Stanford
|
|
619
619
|
'technical report', 'Technical report', 'Technical Report',
|
620
620
|
'working paper', 'Working paper', 'Working Paper'
|
621
621
|
]
|
622
|
-
val << '
|
622
|
+
val << 'Book' if genres and !(genres & article_genres).empty?
|
623
623
|
val << 'Book' if issuance and issuance.include? 'monographic'
|
624
624
|
book_genres = ['conference publication', 'Conference publication', 'Conference Publication',
|
625
625
|
'instruction', 'Instruction',
|
@@ -283,47 +283,47 @@ describe "Format fields (searchworks.rb)" do
|
|
283
283
|
expect(@smods_rec.format_main).to eq ['Archive/Manuscript']
|
284
284
|
end
|
285
285
|
|
286
|
-
context "Article: typeOfResource text, genre" do
|
286
|
+
context "Book, formerly Article: typeOfResource text, genre" do
|
287
287
|
it "'article'" do
|
288
288
|
m = "<mods #{@ns_decl}><typeOfResource>text</typeOfResource><genre authority=\"marcgt\">article</genre></mods>"
|
289
289
|
@smods_rec.from_str(m)
|
290
|
-
expect(@smods_rec.format_main).to eq ['
|
290
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
291
291
|
m = "<mods #{@ns_decl}><typeOfResource>text</typeOfResource><genre authority=\"marcgt\">Article</genre></mods>"
|
292
292
|
@smods_rec.from_str(m)
|
293
|
-
expect(@smods_rec.format_main).to eq ['
|
293
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
294
294
|
end
|
295
295
|
it "'book chapter'", :email => 'mods-squad 2014-05-22, Joanna Dyla' do
|
296
296
|
m = "<mods #{@ns_decl}><genre authority=\"local\">book chapter</genre><typeOfResource>text</typeOfResource></mods>"
|
297
297
|
@smods_rec.from_str(m)
|
298
|
-
expect(@smods_rec.format_main).to eq ['
|
298
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
299
299
|
m = "<mods #{@ns_decl}><genre authority=\"local\">Book chapter</genre><typeOfResource>text</typeOfResource></mods>"
|
300
300
|
@smods_rec.from_str(m)
|
301
|
-
expect(@smods_rec.format_main).to eq ['
|
301
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
302
302
|
m = "<mods #{@ns_decl}><genre authority=\"local\">Book Chapter</genre><typeOfResource>text</typeOfResource></mods>"
|
303
303
|
@smods_rec.from_str(m)
|
304
|
-
expect(@smods_rec.format_main).to eq ['
|
304
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
305
305
|
end
|
306
306
|
it "'issue brief'", :email => 'mods-squad 2014-05-22, Joanna Dyla' do
|
307
307
|
m = "<mods #{@ns_decl}><genre authority=\"local\">issue brief</genre><typeOfResource>text</typeOfResource></mods>"
|
308
308
|
@smods_rec.from_str(m)
|
309
|
-
expect(@smods_rec.format_main).to eq ['
|
309
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
310
310
|
m = "<mods #{@ns_decl}><genre authority=\"local\">Issue brief</genre><typeOfResource>text</typeOfResource></mods>"
|
311
311
|
@smods_rec.from_str(m)
|
312
|
-
expect(@smods_rec.format_main).to eq ['
|
312
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
313
313
|
m = "<mods #{@ns_decl}><genre authority=\"local\">Issue Brief</genre><typeOfResource>text</typeOfResource></mods>"
|
314
314
|
@smods_rec.from_str(m)
|
315
|
-
expect(@smods_rec.format_main).to eq ['
|
315
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
316
316
|
end
|
317
317
|
it "'project report'", :jira => 'GRYP-170', :github => 'gdor-indexer/#7' do
|
318
318
|
m = "<mods #{@ns_decl}><genre>project report</genre><typeOfResource>text</typeOfResource></mods>"
|
319
319
|
@smods_rec.from_str(m)
|
320
|
-
expect(@smods_rec.format_main).to eq ['
|
320
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
321
321
|
m = "<mods #{@ns_decl}><genre>Project report</genre><typeOfResource>text</typeOfResource></mods>"
|
322
322
|
@smods_rec.from_str(m)
|
323
|
-
expect(@smods_rec.format_main).to eq ['
|
323
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
324
324
|
m = "<mods #{@ns_decl}><genre>Project Report</genre><typeOfResource>text</typeOfResource></mods>"
|
325
325
|
@smods_rec.from_str(m)
|
326
|
-
expect(@smods_rec.format_main).to eq ['
|
326
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
327
327
|
end
|
328
328
|
it "'report' isn't valid", :jira => 'GRYP-170', :github => 'gdor-indexer/#7' do
|
329
329
|
m = "<mods #{@ns_decl}><genre>report</genre><typeOfResource>text</typeOfResource></mods>"
|
@@ -333,38 +333,38 @@ describe "Format fields (searchworks.rb)" do
|
|
333
333
|
it "'student project report'", :consul => '/NGDE/Format 2014-05-28' do
|
334
334
|
m = "<mods #{@ns_decl}><genre authority=\"local\">student project report</genre><typeOfResource>text</typeOfResource></mods>"
|
335
335
|
@smods_rec.from_str(m)
|
336
|
-
expect(@smods_rec.format_main).to eq ['
|
336
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
337
337
|
m = "<mods #{@ns_decl}><genre authority=\"local\">Student project report</genre><typeOfResource>text</typeOfResource></mods>"
|
338
338
|
@smods_rec.from_str(m)
|
339
|
-
expect(@smods_rec.format_main).to eq ['
|
339
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
340
340
|
m = "<mods #{@ns_decl}><genre authority=\"local\">Student Project report</genre><typeOfResource>text</typeOfResource></mods>"
|
341
341
|
@smods_rec.from_str(m)
|
342
|
-
expect(@smods_rec.format_main).to eq ['
|
342
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
343
343
|
m = "<mods #{@ns_decl}><genre authority=\"local\">Student Project Report</genre><typeOfResource>text</typeOfResource></mods>"
|
344
344
|
@smods_rec.from_str(m)
|
345
|
-
expect(@smods_rec.format_main).to eq ['
|
345
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
346
346
|
end
|
347
347
|
it "'technical report'", :jira => 'GRYPHONDOR-207' do
|
348
348
|
m = "<mods #{@ns_decl}><genre authority=\"marcgt\">technical report</genre><typeOfResource>text</typeOfResource></mods>"
|
349
349
|
@smods_rec.from_str(m)
|
350
|
-
expect(@smods_rec.format_main).to eq ['
|
350
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
351
351
|
m = "<mods #{@ns_decl}><genre authority=\"marcgt\">Technical report</genre><typeOfResource>text</typeOfResource></mods>"
|
352
352
|
@smods_rec.from_str(m)
|
353
|
-
expect(@smods_rec.format_main).to eq ['
|
353
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
354
354
|
m = "<mods #{@ns_decl}><genre authority=\"marcgt\">Technical Report</genre><typeOfResource>text</typeOfResource></mods>"
|
355
355
|
@smods_rec.from_str(m)
|
356
|
-
expect(@smods_rec.format_main).to eq ['
|
356
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
357
357
|
end
|
358
358
|
it "'working paper'", :email => 'mods-squad 2014-05-22, Joanna Dyla' do
|
359
359
|
m = "<mods #{@ns_decl}><genre authority=\"local\">working paper</genre><typeOfResource>text</typeOfResource></mods>"
|
360
360
|
@smods_rec.from_str(m)
|
361
|
-
expect(@smods_rec.format_main).to eq ['
|
361
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
362
362
|
m = "<mods #{@ns_decl}><genre authority=\"local\">Working paper</genre><typeOfResource>text</typeOfResource></mods>"
|
363
363
|
@smods_rec.from_str(m)
|
364
|
-
expect(@smods_rec.format_main).to eq ['
|
364
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
365
365
|
m = "<mods #{@ns_decl}><genre authority=\"local\">Working Paper</genre><typeOfResource>text</typeOfResource></mods>"
|
366
366
|
@smods_rec.from_str(m)
|
367
|
-
expect(@smods_rec.format_main).to eq ['
|
367
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
368
368
|
end
|
369
369
|
end # Article
|
370
370
|
|
@@ -536,12 +536,12 @@ describe "Format fields (searchworks.rb)" do
|
|
536
536
|
it "multiple genre elements, single typeOfResource" do
|
537
537
|
m = "<mods #{@ns_decl}><typeOfResource>text</typeOfResource><genre>librettos</genre><genre>article</genre></mods>"
|
538
538
|
@smods_rec.from_str(m)
|
539
|
-
expect(@smods_rec.format_main).to eq ['
|
539
|
+
expect(@smods_rec.format_main).to eq ['Book']
|
540
540
|
end
|
541
541
|
it "mish mash" do
|
542
542
|
m = "<mods #{@ns_decl}><typeOfResource>text</typeOfResource><typeOfResource>still image</typeOfResource><genre>librettos</genre><genre>article</genre></mods>"
|
543
543
|
@smods_rec.from_str(m)
|
544
|
-
expect(@smods_rec.format_main).to eq ['
|
544
|
+
expect(@smods_rec.format_main).to eq ['Book', 'Image']
|
545
545
|
end
|
546
546
|
it "doesn't give duplicate values" do
|
547
547
|
m = "<mods #{@ns_decl}><typeOfResource>text</typeOfResource><genre>librettos</genre><genre>thesis</genre></mods>"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stanford-mods
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naomi Dushay
|
@@ -9,76 +9,76 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-08-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mods
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - '>='
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - '>='
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rdoc
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - '>='
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - '>='
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: yard
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - '>='
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rspec
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - '>='
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - '>='
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
description: Stanford specific wrangling of MODS metadata from DOR, the Stanford Digital
|
@@ -92,10 +92,10 @@ extra_rdoc_files:
|
|
92
92
|
- LICENSE
|
93
93
|
- README.rdoc
|
94
94
|
files:
|
95
|
-
-
|
96
|
-
-
|
97
|
-
-
|
98
|
-
-
|
95
|
+
- .coveralls.yml
|
96
|
+
- .gitignore
|
97
|
+
- .travis.yml
|
98
|
+
- .yardopts
|
99
99
|
- Gemfile
|
100
100
|
- LICENSE
|
101
101
|
- README.rdoc
|
@@ -123,17 +123,17 @@ require_paths:
|
|
123
123
|
- lib
|
124
124
|
required_ruby_version: !ruby/object:Gem::Requirement
|
125
125
|
requirements:
|
126
|
-
- -
|
126
|
+
- - '>='
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '0'
|
129
129
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
130
|
requirements:
|
131
|
-
- -
|
131
|
+
- - '>='
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
135
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.2.
|
136
|
+
rubygems_version: 2.2.2
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: Stanford specific wrangling of MODS metadata
|