string_ext 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +15 -6
- data/README.md +0 -1
- data/lib/string_ext.rb +6 -3
- data/lib/string_ext/version.rb +1 -1
- data/string_ext.gemspec +2 -9
- metadata +11 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a7fb5733ea6c14ceaa83b8751270240e8da0d93b1a39f44927bb18606bab1571
|
4
|
+
data.tar.gz: 6fac464db03f3a0eec1b6be3cfeeb892322f7a228ab646509e2f8d1b91174b55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e36d88767d2d7a07b3e866152b3717bca0994abbcf831740ace8f248e13789e5112c7a2b24514d417536aca25ee09d80f96d23962cfd9b33659f391be492b000
|
7
|
+
data.tar.gz: a7df7e3fa6d1055cfa96cbd0db5384e25aa03083582f09625a7bb4c42dea8ff2f93c63d16ff1b137e4c62da726978576dfa3c5e8b49019c255ca195fe1a0c373
|
data/.travis.yml
CHANGED
@@ -1,11 +1,20 @@
|
|
1
1
|
language: ruby
|
2
|
+
|
2
3
|
rvm:
|
3
|
-
- 1.9.3
|
4
4
|
- 2.0
|
5
5
|
- 2.1
|
6
6
|
- 2.2
|
7
|
-
- 2.3
|
8
|
-
- 2.4
|
9
|
-
-
|
10
|
-
|
11
|
-
-
|
7
|
+
- 2.3
|
8
|
+
- 2.4
|
9
|
+
- 2.5
|
10
|
+
- 2.6
|
11
|
+
- 2.7
|
12
|
+
- jruby-9.2.9.0
|
13
|
+
- ruby-head
|
14
|
+
- jruby-head
|
15
|
+
|
16
|
+
matrix:
|
17
|
+
fast_finish: true
|
18
|
+
allow_failures:
|
19
|
+
- rvm: ruby-head
|
20
|
+
- rvm: jruby-head
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
[![Build Status](https://travis-ci.org/gabynaiman/string_ext.svg?branch=master)](https://travis-ci.org/gabynaiman/string_ext)
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/github/gabynaiman/string_ext/badge.svg?branch=master)](https://coveralls.io/github/gabynaiman/string_ext?branch=master)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/gabynaiman/string_ext.svg)](https://codeclimate.com/github/gabynaiman/string_ext)
|
7
|
-
[![Dependency Status](https://gemnasium.com/gabynaiman/string_ext.svg)](https://gemnasium.com/gabynaiman/string_ext)
|
8
7
|
|
9
8
|
String utils for accented and special chars
|
10
9
|
|
data/lib/string_ext.rb
CHANGED
@@ -31,6 +31,11 @@ module StringExt
|
|
31
31
|
upcase: 'ÑÇ' + ACCENTS.values.map { |a| a[:upcase] }.join
|
32
32
|
}
|
33
33
|
|
34
|
+
UNACCENT_REPLACEMENTS = ACCENTS.each_with_object({accented: '', unaccented: ''}) do |(char, cases), replacements|
|
35
|
+
replacements[:accented] += cases[:upcase] + cases[:downcase]
|
36
|
+
replacements[:unaccented] += (char * cases[:upcase].size) + (char.downcase * cases[:downcase].size)
|
37
|
+
end
|
38
|
+
|
34
39
|
extend self
|
35
40
|
|
36
41
|
def upcase(string)
|
@@ -42,9 +47,7 @@ module StringExt
|
|
42
47
|
end
|
43
48
|
|
44
49
|
def unaccented(string)
|
45
|
-
|
46
|
-
s.tr(cases[:upcase], char).tr(cases[:downcase], char.downcase)
|
47
|
-
end
|
50
|
+
string.tr(UNACCENT_REPLACEMENTS[:accented], UNACCENT_REPLACEMENTS[:unaccented])
|
48
51
|
end
|
49
52
|
|
50
53
|
end
|
data/lib/string_ext/version.rb
CHANGED
data/string_ext.gemspec
CHANGED
@@ -18,18 +18,11 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_development_dependency '
|
22
|
-
spec.add_development_dependency '
|
23
|
-
spec.add_development_dependency 'minitest', '~> 5.0'
|
21
|
+
spec.add_development_dependency 'rake', '~> 12.0'
|
22
|
+
spec.add_development_dependency 'minitest', '~> 5.0', '< 5.11'
|
24
23
|
spec.add_development_dependency 'minitest-colorin', '~> 0.1'
|
25
24
|
spec.add_development_dependency 'minitest-line', '~> 0.6'
|
26
25
|
spec.add_development_dependency 'simplecov', '~> 0.12'
|
27
26
|
spec.add_development_dependency 'coveralls', '~> 0.8'
|
28
27
|
spec.add_development_dependency 'pry-nav', '~> 0.2'
|
29
|
-
|
30
|
-
if RUBY_VERSION < '2'
|
31
|
-
spec.add_development_dependency 'term-ansicolor', '~> 1.3.0'
|
32
|
-
spec.add_development_dependency 'tins', '~> 1.6.0'
|
33
|
-
spec.add_development_dependency 'json', '~> 1.8'
|
34
|
-
end
|
35
28
|
end
|
metadata
CHANGED
@@ -1,43 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: string_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.12'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.12'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rake
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
19
|
+
version: '12.0'
|
34
20
|
type: :development
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
26
|
+
version: '12.0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: minitest
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,6 +31,9 @@ dependencies:
|
|
45
31
|
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
33
|
version: '5.0'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '5.11'
|
48
37
|
type: :development
|
49
38
|
prerelease: false
|
50
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,6 +41,9 @@ dependencies:
|
|
52
41
|
- - "~>"
|
53
42
|
- !ruby/object:Gem::Version
|
54
43
|
version: '5.0'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '5.11'
|
55
47
|
- !ruby/object:Gem::Dependency
|
56
48
|
name: minitest-colorin
|
57
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -163,8 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
155
|
- !ruby/object:Gem::Version
|
164
156
|
version: '0'
|
165
157
|
requirements: []
|
166
|
-
|
167
|
-
rubygems_version: 2.6.8
|
158
|
+
rubygems_version: 3.0.6
|
168
159
|
signing_key:
|
169
160
|
specification_version: 4
|
170
161
|
summary: String utils for accented and special chars
|