stanford-mods 3.3.1 → 3.3.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: f4b93a6a17a1d2d60d82a661d02d6ba4a74f6c9958597a9895650506b4f4c4b1
4
- data.tar.gz: a63b8a8a5bd2c6b638082936e5ee908613cb981447b016e6b8d3beed8c2637b8
3
+ metadata.gz: f9965ea8ea7f816965eec61fa92029644ba60a06eb42a70fb6f8807acbc60a99
4
+ data.tar.gz: f7c66e2131c71ebafb854ac8a71c11bd6b53c3c964ce6991385923a7193811bc
5
5
  SHA512:
6
- metadata.gz: b61ce90be97c3b7b314f5b2a199f18bbb8843c8de704703a71a55540241ee4aa3307b1683b0c6b60de170de781d08cb702233cef1626a69af09bd78dc8590253
7
- data.tar.gz: 1fcc5a1238cab589e41ee281dad172c24adea68b718401a643bcc71e138b0623a8d54717fb89204cf708e014b0dfc638a5fb307dd2bf5716e6fb74bfb84087f1
6
+ metadata.gz: 053b6d5241ad55d53f29c95cf4654af7af6f780685a1f3fa0b528570b8506dfc76d85bf4d1a72c90fa64177155763c8579035e141659e4a61a2e84ab2f67c222
7
+ data.tar.gz: 595307259386899b1617baea478517a86b6b245e62345b496495e280478b8e6f7e58ddcb68443b010c1045f586dbe8a17e879bc020ce4c8c711630bd48b11189
@@ -9,7 +9,7 @@ module Stanford
9
9
  mods_ng_xml.language.flat_map do |n|
10
10
  # get languageTerm codes and add their translations to the result
11
11
  result = n.code_term.flat_map do |ct|
12
- if ct.authority =~ /^iso639/
12
+ if ct.authority.to_s =~ /^iso639/
13
13
  vals = ct.text.split(/[,|\ ]/).reject { |x| x.strip.empty? }
14
14
  vals.select { |v| ISO_639.find(v.strip) }.map do |v|
15
15
  iso639_val = ISO_639.find(v.strip).english_name
@@ -114,11 +114,11 @@ module Stanford
114
114
  val.uniq
115
115
  end
116
116
 
117
- # @return [String] value with the numeric catkey in it, or nil if none exists
117
+ # @return [String] value with the catkey in it, or nil if none exists
118
118
  def catkey
119
119
  catkey = term_values([:record_info, :recordIdentifier])
120
120
 
121
- catkey.first&.tr('a', '') # ensure catkey is numeric only
121
+ catkey.first&.tr('a', '') # remove prefix from SUL catkeys
122
122
  end
123
123
  end # class Record
124
124
  end # Module Mods
@@ -1,6 +1,6 @@
1
1
  module Stanford
2
2
  module Mods
3
3
  # this is the Ruby Gem version
4
- VERSION = '3.3.1'.freeze
4
+ VERSION = '3.3.3'.freeze
5
5
  end
6
6
  end
@@ -13,7 +13,7 @@ describe "Searchworks mixin for Stanford::Mods::Record" do
13
13
  expect(langs.size).to eq(3)
14
14
  expect(langs).to include("Persian", "Arabic", "Dutch")
15
15
  expect(langs).not_to include("Dutch; Flemish")
16
- end
16
+ end
17
17
  it "should return a language string from lookup for a valid language code that has a type=code specified but no authority" do
18
18
  m = "<mods #{@ns_decl}> <language><languageTerm type='code'>eng</languageTerm></language></mods>"
19
19
  @smods_rec.from_str m
@@ -63,6 +63,13 @@ describe "Searchworks mixin for Stanford::Mods::Record" do
63
63
  expect(langs.size).to eq 1
64
64
  expect(langs).to include "English"
65
65
  end
66
+ it "handles codes without authority elements" do
67
+ m = "<mods #{@ns_decl}><language><languageTerm type='code'>eng</languageTerm></language></mods>"
68
+ @smods_rec.from_str m
69
+ langs = @smods_rec.sw_language_facet
70
+ expect(langs.size).to eq 1
71
+ expect(langs).to include "English"
72
+ end
66
73
  end
67
74
 
68
75
  context "sw author methods" do
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: 3.3.1
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naomi Dushay
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-08-03 00:00:00.000000000 Z
12
+ date: 2023-09-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mods
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  requirements: []
217
- rubygems_version: 3.3.7
217
+ rubygems_version: 3.4.10
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: Stanford specific wrangling of MODS metadata