stanford-mods 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/mappings_hash.rb +1 -1
- data/lib/stanford-mods/physical_location.rb +3 -2
- data/lib/stanford-mods/version.rb +1 -1
- data/spec/physical_location_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 691c6e601bb934cb7a1e396d901a6f8205c54b35
|
4
|
+
data.tar.gz: 5efa051bf96155491d58b1bc45c335c138f6b171
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6eb960553c5e11b42ebe3a3ddc86ab41a60ce37d10511380914c95e4bcbbf8ba1b71547313e8be6af97d4850ca4310032b34de920e6075ba33de0e2601bc1ff
|
7
|
+
data.tar.gz: 307a7186e583b23980bb321f614bdc2c8b92dc51895a1cbc959dfba5f7838a5822e71726332b2ba0330b3edd7d0b2d992dc3f9d1a542259004fffcd33fb441eb
|
data/config/mappings_hash.rb
CHANGED
@@ -30,7 +30,7 @@ name_to_xpath = {
|
|
30
30
|
'physical_description_form' => '//physicalDescription/form/text()', # .to_s
|
31
31
|
'physical_description_media_type' => '//physicalDescription/internetMediaType/text()', # .to_s
|
32
32
|
|
33
|
-
#
|
33
|
+
# physical_location
|
34
34
|
'physical_location' => '//location/physicalLocation/text()', # .to_s
|
35
35
|
'location_url' => '//location/url/text()', # .to_s
|
36
36
|
|
@@ -47,12 +47,13 @@ module Stanford
|
|
47
47
|
folder_num.first
|
48
48
|
end
|
49
49
|
|
50
|
-
# return entire contents of physicalLocation (note: single valued)
|
50
|
+
# return entire contents of physicalLocation as a string (note: single valued)
|
51
51
|
# but only if it has series, accession, box or folder data
|
52
52
|
# data in location/physicalLocation or in relatedItem/location/physicalLocation
|
53
53
|
# so use _location to get the data from either one of them
|
54
54
|
# TODO: should it be hierarchical series/box/folder?
|
55
|
-
|
55
|
+
# NOTE: there is a "physicalLocation" and a "location" method defined in the mods gem, so we cannot use these names to avoid conflicts
|
56
|
+
def physical_location_str
|
56
57
|
# _location.physicalLocation should find top level and relatedItem
|
57
58
|
loc = @mods_ng_xml._location.physicalLocation.map do |node|
|
58
59
|
node.text if node.text.match(/.*(Series)|(Accession)|(Folder)|(Box).*/i)
|
@@ -179,19 +179,19 @@ describe "Physical Location for series, box, folder" do
|
|
179
179
|
context 'in /location/physicalLocation' do
|
180
180
|
it "has the expected location '#{expected}'" do
|
181
181
|
@smods_rec.from_str(mods_loc_phys_loc)
|
182
|
-
expect(@smods_rec.
|
182
|
+
expect(@smods_rec.physical_location_str).to eq expected
|
183
183
|
end
|
184
184
|
end
|
185
185
|
context 'in /relatedItem/location/physicalLocation' do
|
186
186
|
it "has the expected location '#{expected}'" do
|
187
187
|
@smods_rec.from_str(mods_rel_item_loc_phys_loc)
|
188
|
-
expect(@smods_rec.
|
188
|
+
expect(@smods_rec.physical_location_str).to eq expected
|
189
189
|
end
|
190
190
|
end
|
191
191
|
context 'with multiple physicalLocation elements' do
|
192
192
|
it "has the expected location '#{expected}'" do
|
193
193
|
@smods_rec.from_str(mods_loc_multiple_phys_loc)
|
194
|
-
expect(@smods_rec.
|
194
|
+
expect(@smods_rec.physical_location_str).to eq expected
|
195
195
|
end
|
196
196
|
end
|
197
197
|
end # for example
|
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: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naomi Dushay
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
169
|
rubyforge_project:
|
170
|
-
rubygems_version: 2.4.
|
170
|
+
rubygems_version: 2.4.6
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Stanford specific wrangling of MODS metadata
|