dwc_agent 0.2.2 → 0.2.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: 5175936a78d6dc64f17a2827dccfaa80c66f07242b17639b3668e6403e9a19b7
4
- data.tar.gz: a13ead08f2756db93e5abaff55d2cd9316b7ee0739926571045d52abfc4243c8
3
+ metadata.gz: 0b78266edf4bba3e709436eea17e10a3f368487ab6b2e2d500390f6f18eef8cd
4
+ data.tar.gz: 14464308a3ffb8139305eabdf04bfe032e0d6de526e303980ff4fe165165ec7b
5
5
  SHA512:
6
- metadata.gz: 368ea5fd8755f19dafd4b651fc68ef89a0e34246deedd6261b4cd97ec3dbf6b3f4eb13bcc3e7552ce46d77f25b721e9269e4082b861681486dfb12a797e8c254
7
- data.tar.gz: f61d5cc267f5b210a327431eec44da687d03d991455e6c7797aa6d1aac1fca47c2664e8579143e46951c1413cafb068acc5d8fb13ad9c0c76442ccc578581833
6
+ metadata.gz: 805e512bbfb76d17b45ad33f0ac5d550f5c4e3add36f09d9fe5053169bc3a5e357783c7512b21f91a816288685ad97cf12b53540272b475d7bdd6172bb9ed83b
7
+ data.tar.gz: c220b4bedf8b8914035ce3a2e2e5e9742c566bcf28ce8b2488efbb9aa2c5dfd881819bf666c9583b9f1151c06b44425a7614e0d6ab5cda9d5ca2d68965d85130
@@ -14,6 +14,13 @@ module DwcAgent
14
14
  title: TITLE
15
15
  }
16
16
  @namae = Namae::Parser.new(options)
17
+
18
+ @strip_out_regex = Regexp.new STRIP_OUT.to_s
19
+ @residual_terminators_regex = Regexp.new SPLIT_BY.to_s + %r{\s*\z}.to_s
20
+ @char_subs_regex = Regexp.new [CHAR_SUBS.keys.join('\\')].to_s
21
+ @phrase_subs_regex = Regexp.new (PHRASE_SUBS.keys.join('|')).to_s
22
+ @complex_separators_regex = Regexp.new COMPLEX_SEPARATORS.to_s
23
+ @add_separators_regex = Regexp.new %r{([A-Z]{1}\.)([[:alpha:]]{2,})}.to_s
17
24
  end
18
25
 
19
26
  # Parses the passed-in string and returns a list of names.
@@ -22,13 +29,12 @@ module DwcAgent
22
29
  # @return [Array] the list of parsed names
23
30
  def parse(name)
24
31
  return [] if name.nil? || name == ""
25
- residual_terminators_regex = Regexp.new SPLIT_BY.to_s + %r{\s*\z}.to_s
26
- name.gsub!(STRIP_OUT, ' ')
27
- name.gsub!(/[#{CHAR_SUBS.keys.join('\\')}]/, CHAR_SUBS)
28
- name.gsub!(/(#{PHRASE_SUBS.keys.join('|')})/, PHRASE_SUBS)
29
- name.gsub!(/([A-Z]{1}\.)([[:alpha:]]{2,})/, '\1 \2')
30
- name.gsub!(COMPLEX_SEPARATORS, '\1 | \2')
31
- name.gsub!(residual_terminators_regex, '')
32
+ name.gsub!(@strip_out_regex, ' ')
33
+ name.gsub!(@char_subs_regex, CHAR_SUBS)
34
+ name.gsub!(@phrase_subs_regex, PHRASE_SUBS)
35
+ name.gsub!(@add_separators_regex, '\1 \2')
36
+ name.gsub!(@complex_separators_regex, '\1 | \2')
37
+ name.gsub!(@residual_terminators_regex, '')
32
38
  name.squeeze!(' ')
33
39
  name.strip!
34
40
  @namae.parse(name)
@@ -3,7 +3,7 @@ module DwcAgent
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 2
6
- PATCH = 2
6
+ PATCH = 3
7
7
  BUILD = nil
8
8
 
9
9
  def self.version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dwc_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David P. Shorthouse