name-tamer 0.1.5 → 0.1.6

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: 5ab141545fd0a40633767d4bbec43fd9170a4023
4
- data.tar.gz: c2ad25c3863f39082990e4cb1d2c51c2edae8456
3
+ metadata.gz: 2706fda214e230fdf9bda63cc4424842183672e3
4
+ data.tar.gz: 89f191da4268cfbca81674335e3dfe5abec626a0
5
5
  SHA512:
6
- metadata.gz: 63b3be31c544c28c1de9d9ce0faa243622438db313701273fcf382799bef138d11588841811f16cc7b85df016b3cbdf8e9a79fd69282104ccf8dc907a6dbef2b
7
- data.tar.gz: cf0cfeaa251ea8942f43d91ba75abb41575a9476f2907735b0b285ada2c5dfc42326d550b17c125fb463e372b9e31d38705d88a958f61de9a00054b5879511b4
6
+ metadata.gz: cc8d7e0474059fe5e3680cc720655c303628fbb1ea25fe638e2e630582374720dd867b1b149c18990503d2c7e3d68ead42b896f41331c2fc650f13287146e438
7
+ data.tar.gz: 16e081e040d86117620e5a1760e8cf49328264adf9488ab29f3f8649d4e732247f30b4ed430005bd5ba51063ce03d196728e9323e0b1b300912dd32993282de8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- name-tamer (0.1.4)
4
+ name-tamer (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/name-tamer.rb CHANGED
@@ -241,10 +241,11 @@ class NameTamer
241
241
  end
242
242
 
243
243
  def standardize_words
244
- @simple_name.gsub!(/ *& */, ' and ') # replace ampersand characters with ' and '
245
- @simple_name.gsub!(/ *\+ */, ' plus ') # replace plus signs with ' plus '
246
- @simple_name.gsub!(/\bintl\b/i, 'International') # replace 'intl' with 'International'
247
- @simple_name.gsub!(/["“”]/, '') # remove quotes
244
+ @simple_name.gsub!(/ *& */, ' and ') # replace ampersand characters with ' and '
245
+ @simple_name.gsub!(/ *\+ */, ' plus ') # replace plus signs with ' plus '
246
+ @simple_name.gsub!(/\bintl\b/i, 'International') # replace 'intl' with 'International'
247
+ @simple_name.gsub!(/[־‐‑‒–—―−﹘﹣-]/, SLUG_DELIMITER) # Replace Unicode dashes with ASCII hyphen
248
+ @simple_name.strip_unwanted!(/["“”™℠®©℗]/) # remove quotes and commercial decoration
248
249
  end
249
250
 
250
251
  #--------------------------------------------------------
@@ -364,7 +365,7 @@ class NameTamer
364
365
  new_string
365
366
  .whitespace_to!(sep)
366
367
  .invalid_chars_to!(sep)
367
- .strip_invalid!(filter)
368
+ .strip_unwanted!(filter)
368
369
  .fix_separators!(sep)
369
370
  .approximate_latin_chars!
370
371
 
@@ -1,3 +1,3 @@
1
1
  class NameTamer
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
data/lib/string_extras.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  class String
3
3
  # Strip illegal characters out completely
4
- def strip_invalid!(filter)
4
+ def strip_unwanted!(filter)
5
5
  self.gsub!(filter, '')
6
6
  self # Allows chaining
7
7
  end
@@ -133,8 +133,8 @@ describe NameTamer do
133
133
  { n: 'โชติวัน วัฒนลาภ', t: :organization, nn: 'โชติวัน วัฒนลาภ', sn: 'โชติวัน วัฒนลาภ', s: 'โชติวัน-วัฒนลาภ' },
134
134
  { n: '張 續寶', t: :organization, nn: '張 續寶', sn: '張 續寶', s: '張-續寶' },
135
135
  { n: 'Юрий Гайдук', t: :organization, nn: 'Юрий Гайдук', sn: 'Юрий Гайдук', s: 'Юрий-Гайдук' },
136
- { n: '☣ ©Ʀѱ∏†ʘ Σɏ§†℈Ϻ ☣', t: :organization, nn: '☣ ©Ʀѱ∏†ʘ Σɏ§†℈Ϻ ☣', sn: '☣ ©Ʀѱ∏†ʘ Σɏ§†℈Ϻ ☣',
137
- s: '☣-©Ʀѱ∏†ʘ-Σɏ§†℈Ϻ-☣' },
136
+ { n: '☣ ©Ʀѱ∏†ʘ Σɏ§†℈Ϻ ☣', t: :organization, nn: '☣ ©Ʀѱ∏†ʘ Σɏ§†℈Ϻ ☣', sn: '☣ Ʀѱ∏†ʘ Σɏ§†℈Ϻ ☣',
137
+ s: '☣-Ʀѱ∏†ʘ-Σɏ§†℈Ϻ-☣' },
138
138
  { n: '♠ KlasikB0i ♠', t: :organization, nn: '♠ KlasikB0i ♠', sn: '♠ KlasikB0i ♠', s: '♠-klasikb0i-♠' },
139
139
  { n: '* Shorusan *', t: :organization, nn: '* Shorusan *', sn: '* Shorusan *', s: 'shorusan' },
140
140
  { n: '项目谷', t: :organization, nn: '项目谷', sn: '项目谷', s: '项目谷' },
@@ -169,7 +169,19 @@ describe NameTamer do
169
169
  { n: 'John Smith M.A. (Oxon)', t: :person, nn: 'John Smith', sn: 'John Smith', s: 'john-smith' },
170
170
  { n: 'I B M', t: :organization, nn: 'Ibm', sn: 'Ibm', s: 'ibm' },
171
171
  { n: 'I-B-M', t: :organization, nn: 'I-B-M', sn: 'I-B-M', s: 'i-b-m' },
172
- { n: 'I.B.M.', t: :organization, nn: 'I.B.M.', sn: 'IBM', s: 'ibm' }
172
+ { n: 'I.B.M.', t: :organization, nn: 'I.B.M.', sn: 'IBM', s: 'ibm' },
173
+ { n: 'Unusuals — the ad industry network', t: :organization,
174
+ nn: 'Unusuals — the ad industry network',
175
+ sn: 'Unusuals - the ad industry network',
176
+ s: 'unusuals-the-ad-industry-network'
177
+ },
178
+ {
179
+ n: 'Scout® Loyalty Optimizer',
180
+ t: :organization,
181
+ nn: 'Scout® Loyalty Optimizer',
182
+ sn: 'Scout Loyalty Optimizer',
183
+ s: 'scout-loyalty-optimizer'
184
+ }
173
185
  ]
174
186
  end
175
187
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: name-tamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xenapto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-25 00:00:00.000000000 Z
11
+ date: 2014-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler