name-tamer 0.2.7 → 0.2.8

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
  SHA1:
3
- metadata.gz: defc3ce199adb7c6d974aa9872d78c90eaa919d5
4
- data.tar.gz: 3cb6c1c753e5ea5fb074ef88b8208a0ed15ce7c5
3
+ metadata.gz: 584408a915c3b55c01d600ae7cee7dad1585b7d9
4
+ data.tar.gz: aeec9318693df40e29d3444e78d57262aa749711
5
5
  SHA512:
6
- metadata.gz: 98f52d3cefad2822a50dcc15c7711abf86be007b344999fb7b3f30b8cc7410425597795484b4c3b86cbc1c8aecf55c48a31e2005b88d9afb1e0b828b1b7f1cfb
7
- data.tar.gz: f773c2d26d9d7a983c190a2318b83f28a04b4e6b353932c10d379d65c422ea9d204a1a49c3715e14eff1351e32668cfe8d8c9dd3e2d55716873c506a54ab0e5d
6
+ metadata.gz: cb502da77de553dd0e451f8829770851de8bf7a6f180be99361c05f50278cd773fc0d347fbfa65969131b5f5e9374defacee2677d39a03372f8a18ec8bc4b589
7
+ data.tar.gz: 4381197a9a181b4c4a135e53c01576b8edd4068c7e9a4517796124814ba0ff6e3adf2d3fdc17d20eab6a010f8d332a5de07fbd91af5abcf8fed0b3fe9ad78aa2
data/Gemfile.lock CHANGED
@@ -1,27 +1,25 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- name-tamer (0.2.4)
4
+ name-tamer (0.2.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- coveralls (0.7.1)
9
+ coveralls (0.7.2)
10
10
  multi_json (~> 1.3)
11
- rest-client
11
+ rest-client (= 1.6.7)
12
12
  simplecov (>= 0.7)
13
- term-ansicolor
14
- thor
13
+ term-ansicolor (= 1.2.2)
14
+ thor (= 0.18.1)
15
15
  diff-lcs (1.2.5)
16
16
  docile (1.1.5)
17
17
  gem-release (0.7.3)
18
- mime-types (2.4.2)
18
+ mime-types (2.4.3)
19
19
  multi_json (1.10.1)
20
- netrc (0.8.0)
21
- rake (10.3.2)
22
- rest-client (1.7.2)
23
- mime-types (>= 1.16, < 3.0)
24
- netrc (~> 0.7)
20
+ rake (10.4.2)
21
+ rest-client (1.6.7)
22
+ mime-types (>= 1.16)
25
23
  rspec (2.99.0)
26
24
  rspec-core (~> 2.99.0)
27
25
  rspec-expectations (~> 2.99.0)
@@ -35,10 +33,10 @@ GEM
35
33
  multi_json (~> 1.0)
36
34
  simplecov-html (~> 0.8.0)
37
35
  simplecov-html (0.8.0)
38
- term-ansicolor (1.3.0)
39
- tins (~> 1.0)
40
- thor (0.19.1)
41
- tins (1.3.3)
36
+ term-ansicolor (1.2.2)
37
+ tins (~> 0.8)
38
+ thor (0.18.1)
39
+ tins (0.13.2)
42
40
 
43
41
  PLATFORMS
44
42
  ruby
@@ -1,3 +1,3 @@
1
1
  class NameTamer
2
- VERSION = '0.2.7'
2
+ VERSION = '0.2.8'
3
3
  end
data/lib/string_extras.rb CHANGED
@@ -30,6 +30,9 @@ class String
30
30
  # so we take precautions
31
31
  def safe_unescape!
32
32
  string = URI.unescape(self)
33
+ rescue Encoding::CompatibilityError # e.g. "\u2019%80"
34
+ return self
35
+ else
33
36
  return self if self == string
34
37
  replace string
35
38
  ensure_safe!
@@ -186,7 +186,8 @@ describe NameTamer do
186
186
  { n: 'René Descartes', t: :person, nn: 'René Descartes', sn: 'René Descartes', s: 'rene-descartes' },
187
187
  { n: 'John “Jonno” Johnson', t: :person, nn: 'John “Jonno” Johnson', sn: 'John Johnson', s: 'john-johnson' },
188
188
  { n: 'Pablo M Sánchez', t: :person, nn: 'Pablo M Sánchez', sn: 'Pablo Sánchez', s: 'pablo-sanchez' },
189
- { n: "\xc3\x28", t: :person, nn: '()', sn: '()', s: '_' } # Invalid byte sequence in UTF-8
189
+ { n: "\xc3\x28", t: :person, nn: '()', sn: '()', s: '_' }, # Invalid byte sequence in UTF-8
190
+ { n: '’%80', t: :person, nn: '’%80', sn: '’%80', s: '’80' } # Encoding::CompatibilityError
190
191
  ]
191
192
  end
192
193
 
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.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xenapto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-22 00:00:00.000000000 Z
11
+ date: 2014-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler