dwc_agent 1.5.1.2 → 1.5.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46975c588975ffd636e3c07506e27c0121e9af9acbc1e7b36275bedb5bc67f29
4
- data.tar.gz: c39f8a7f561fa69abc0ba5cb0f8a67d545f63356dc28c7eb27c465ac20824c3c
3
+ metadata.gz: 8f1a07e6b4a0c4819107295a79d395321dbf73772c81cb32013a66a88baeedda
4
+ data.tar.gz: b686b2cbcefb91d8a35f24e6364528683b40f15a833b5c7a5297f862b7ff64a0
5
5
  SHA512:
6
- metadata.gz: d974871f6ce3c31424d2802bff332190b702cacb1008e82c2827f63da30643506b71b484be05c436a4d6cf2f8ab841979bd626ee721a8a4230e07fe2b96b97c4
7
- data.tar.gz: 8ade64986b8f7774cfdc8bb9170a1ad3134b0ec6dc84d81aab1909175f1ec48af1df260c10bb7c113b73ae1da16f6f0163fcf8fd57b3579c718666f31fe8aac7
6
+ metadata.gz: 120885a8b97055dcc5e91ad5a00c763b4de2db4a825557f6a8231f3ef314a160a59d24352f2f56bdaa78b61539b7c794801b64bf53af3c0893fbbdb5b36edb6a
7
+ data.tar.gz: 3d3529434a1e5be6ab372dff55af6cb0debedfc8dbbcd9f78a00d3b62093487359d054c62df33723bd56ee1dffa7bcf9c3102dda28a0cca77b40529fea5fc3fd
@@ -191,9 +191,11 @@ module DwcAgent
191
191
  '-Jr' => ' Jr.'
192
192
  }
193
193
 
194
- COMPLEX_SEPARATORS = %r{
195
- ^(\S{4,},\s+(?:\S\.\s*){1,})\s+(\S{4,},\s+(?:\S\.\s*){1,})$
196
- }x
194
+ SEPARATORS = {
195
+ "^(\\S{4,},\\s+(?:\\S\\.\\s*){1,})\\s+(\\S{4,},\\s+(?:\\S\.\\s*){1,})$" => "\\1 | \\2",
196
+ "(\\S{1}\\.)([[:alpha:]]{2,})" => "\\1 \\2",
197
+ "(.*)\s+(.*)\s+(van|von)$" => "\\3 \\1, \\2"
198
+ }
197
199
 
198
200
  BLACKLIST = %r{
199
201
  (?i:abundant)|
@@ -16,13 +16,10 @@ module DwcAgent
16
16
  suffix: SUFFIX
17
17
  }
18
18
  @namae = Namae::Parser.new(options)
19
-
20
19
  @strip_out_regex = Regexp.new STRIP_OUT.to_s
21
- @residual_terminators_regex = Regexp.new SPLIT_BY.to_s + %r{\s*\z}.to_s
22
20
  @char_subs_regex = Regexp.new [CHAR_SUBS.keys.join].to_s
23
21
  @phrase_subs_regex = Regexp.new PHRASE_SUBS.keys.map{|a| Regexp.escape a }.join('|').to_s
24
- @complex_separators_regex = Regexp.new COMPLEX_SEPARATORS.to_s
25
- @add_separators_regex = Regexp.new %r{(\S{1}\.)([[:alpha:]]{2,})}.to_s
22
+ @residual_terminators_regex = Regexp.new SPLIT_BY.to_s + %r{\s*\z}.to_s
26
23
  end
27
24
 
28
25
  # Parses the passed-in string and returns a list of names.
@@ -35,8 +32,7 @@ module DwcAgent
35
32
  name.gsub!(/\[|\]/, '')
36
33
  name.gsub!(@char_subs_regex, CHAR_SUBS)
37
34
  name.gsub!(@phrase_subs_regex, PHRASE_SUBS)
38
- name.gsub!(@add_separators_regex, '\1 \2')
39
- name.gsub!(@complex_separators_regex, '\1 | \2')
35
+ SEPARATORS.each{|key, value| name.gsub!(Regexp.new(key), value)}
40
36
  name.gsub!(@residual_terminators_regex, '')
41
37
  name.squeeze!(' ')
42
38
  name.strip!
@@ -4,7 +4,7 @@ module DwcAgent
4
4
  MAJOR = 1
5
5
  MINOR = 5
6
6
  PATCH = 1
7
- BUILD = 2
7
+ BUILD = 3
8
8
 
9
9
  def self.version
10
10
  [MAJOR, MINOR, PATCH, BUILD].compact.join('.').freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dwc_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1.2
4
+ version: 1.5.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David P. Shorthouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-26 00:00:00.000000000 Z
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: namae
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.1.2
122
+ rubygems_version: 3.2.4
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Parse Darwin Core agent terms such as recordedBy and identifiedBy