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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ceba18b41d0f172731b399e387b32ecd9f8a1c7b
4
- data.tar.gz: a13407d8872f1b02eaf08e0b571b0887ef15d568
3
+ metadata.gz: 691c6e601bb934cb7a1e396d901a6f8205c54b35
4
+ data.tar.gz: 5efa051bf96155491d58b1bc45c335c138f6b171
5
5
  SHA512:
6
- metadata.gz: f685d94af38eb9516590935b5eea6b904e4a8eed947006ad8cebe145879cfa15869d260213d2fbc442a2cb0e36cea40af4ab8bcef389155f1cbf59a406f170a7
7
- data.tar.gz: 06189a66038f38bb22664b6169811686a8242ce9995d9d3459a2da4cf02bafc39aae42cffd0cf8a44fe642f3c68e0e1a3b6a9cacd860792dad0c6db9c68967f4
6
+ metadata.gz: d6eb960553c5e11b42ebe3a3ddc86ab41a60ce37d10511380914c95e4bcbbf8ba1b71547313e8be6af97d4850ca4310032b34de920e6075ba33de0e2601bc1ff
7
+ data.tar.gz: 307a7186e583b23980bb321f614bdc2c8b92dc51895a1cbc959dfba5f7838a5822e71726332b2ba0330b3edd7d0b2d992dc3f9d1a542259004fffcd33fb441eb
@@ -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
- # location
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
- def location
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)
@@ -1,6 +1,6 @@
1
1
  module Stanford
2
2
  module Mods
3
3
  # this is the Ruby Gem version
4
- VERSION = "2.0.0"
4
+ VERSION = "2.1.0"
5
5
  end
6
6
  end
@@ -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.location).to eq expected
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.location).to eq expected
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.location).to eq expected
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.0.0
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.8
170
+ rubygems_version: 2.4.6
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Stanford specific wrangling of MODS metadata