name-tamer 0.1.8 → 0.1.9

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: 5238d58c1fd96ae9b61193c2b4e6b64deb1a7866
4
- data.tar.gz: c881c108d88814dcf2cb76dc610a3581cdfb5204
3
+ metadata.gz: b556d5a36fcb89c56e435fd67a0f159987b7f8b9
4
+ data.tar.gz: 7ac8e5b948e6edb607f367d4d8303bb3c97c0d9d
5
5
  SHA512:
6
- metadata.gz: ad2db97d850d80e73281f707b4d0a9ad27e1b23dd6d13ca5a389934a1c0cc1c73dfd5b20368c4b2306460216941ad55ac76d5a1f2e14f596c23a1dd0f46eeaba
7
- data.tar.gz: e8817a9dcab4a62e7846b151b7bf9b45c5726ee409c1d01d54aa065ecce29a2ad7220e215a10d3ea4e32ad630a398fa5f50fb856b313830d48402e2eb303d2ac
6
+ metadata.gz: 215966db363f5630a1b53671c95792057deb29306a07e1cf93c1772700be4b3fc3e4f9cab40a1ba6d39f58813eddead3226d1faa2583aa21e3d73f41eb2c1403
7
+ data.tar.gz: 4d2bcd7d0f9b8556c548235c4d12ae0c92643399444a2ce70c5e9b8ef984577d54915827a86f4b243d3434775a1ddb37ccd1d0055b8645c56ab770bdba558613
@@ -7,4 +7,4 @@ CyclomaticComplexity:
7
7
  ClassLength:
8
8
  Description: 'Avoid classes longer than 100 lines of code.'
9
9
  CountComments: false # count full line comments?
10
- Max: 305
10
+ Max: 316
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- name-tamer (0.1.7)
4
+ name-tamer (0.1.8)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -21,13 +21,22 @@ class NameTamer
21
21
  end
22
22
  end
23
23
 
24
- def nice_name
25
- unless @nice_name
26
- @nice_name = name.dup # Start with the name we've received
24
+ def tidy_name
25
+ unless @tidy_name
26
+ @tidy_name = name.dup # Start with the name we've received
27
27
 
28
28
  tidy_spacing # " John Smith " -> "John Smith"
29
29
  fix_encoding_errors # "Ren\u00c3\u00a9 Descartes" -> "Ren\u00e9 Descartes"
30
30
  consolidate_initials # "I. B. M." -> "I.B.M."
31
+ end
32
+
33
+ @tidy_name
34
+ end
35
+
36
+ def nice_name
37
+ unless @nice_name
38
+ @nice_name = tidy_name.dup # Start with the tidied name
39
+
31
40
  remove_adfixes # prefixes and suffixes: "Smith, John, Jr." -> "Smith, John"
32
41
  fixup_last_name_first # "Smith, John" -> "John Smith"
33
42
  fixup_mismatched_braces # "Ceres (AZ" -> "Ceres (AZ)"
@@ -103,19 +112,19 @@ class NameTamer
103
112
  #--------------------------------------------------------
104
113
 
105
114
  def tidy_spacing
106
- @nice_name
115
+ @tidy_name
107
116
  .space_after_comma!
108
117
  .strip_or_self!
109
118
  .whitespace_to!(ASCII_SPACE)
110
119
  end
111
120
 
112
121
  def fix_encoding_errors
113
- @nice_name.fix_encoding_errors!
122
+ @tidy_name.fix_encoding_errors!
114
123
  end
115
124
 
116
125
  # Remove spaces from groups of initials
117
126
  def consolidate_initials
118
- @nice_name
127
+ @tidy_name
119
128
  .remove_spaces_from_initials!
120
129
  .ensure_space_after_initials!
121
130
  end
@@ -1,3 +1,3 @@
1
1
  class NameTamer
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: name-tamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xenapto