fedux_org-stdlib 0.10.0 → 0.10.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ab7864317eba3f95f3e9471b7ff3647220ef3fc
|
4
|
+
data.tar.gz: 3d7c27a31e36b1c53343d0ca0b82dd189af103c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49b2c656b0ed717f547dd69883f5f0b5c948c6dc6ac00155395baca831599442b4480b309d25619bb387c450b08518275c4d5232c61b60ae7de011eb231cc3af
|
7
|
+
data.tar.gz: f4498bbefde2c432ac77ecc27bc4e2ed8c4daa81e5144e959e319afbe319ff25279d9f68409fa8cc19e0e055c76a55a34c095717963bce1c365963bc478c1473
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'fedux_org_stdlib/require_files'
|
3
|
+
require_library %w(active_support/core_ext/string/strip active_support/core_ext/string/inflections)
|
4
|
+
|
5
|
+
# String
|
6
|
+
class String
|
7
|
+
# Convert string to characters only
|
8
|
+
#
|
9
|
+
# This will remove accents and umlauts and other special characters
|
10
|
+
#
|
11
|
+
# @example Simple Example
|
12
|
+
#
|
13
|
+
# 'ä'.characterize
|
14
|
+
# #=> 'a'
|
15
|
+
def characterize
|
16
|
+
ActiveSupport::Inflector.transliterate(self).parameterize
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'fedux_org_stdlib/core_ext/string/characterize'
|
3
|
+
|
4
|
+
RSpec.describe String do
|
5
|
+
context '#characterize' do
|
6
|
+
it 'removes accents' do
|
7
|
+
expect('á'.characterize).to eq 'a'
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'removes umlauts' do
|
11
|
+
expect('ä'.characterize).to eq 'a'
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'removes special characters "§$%&/()=?!\t' do
|
15
|
+
expect(%('°^!"§$%&/()=?!\t
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fedux_org-stdlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Meyer
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- lib/fedux_org_stdlib/core_ext/shellwords.rb
|
73
73
|
- lib/fedux_org_stdlib/core_ext/shellwords/clean.rb
|
74
74
|
- lib/fedux_org_stdlib/core_ext/string.rb
|
75
|
+
- lib/fedux_org_stdlib/core_ext/string/characterize.rb
|
75
76
|
- lib/fedux_org_stdlib/core_ext/string/underline.rb
|
76
77
|
- lib/fedux_org_stdlib/directory_finder.rb
|
77
78
|
- lib/fedux_org_stdlib/directory_finder/exceptions.rb
|
@@ -181,6 +182,7 @@ files:
|
|
181
182
|
- spec/core_ext/hash/list_spec.rb
|
182
183
|
- spec/core_ext/hash/options_spec.rb
|
183
184
|
- spec/core_ext/shellwords/clean_spec.rb
|
185
|
+
- spec/core_ext/string/characterize_spec.rb
|
184
186
|
- spec/core_ext/string/underline_spec.rb
|
185
187
|
- spec/directory_finder_spec.rb
|
186
188
|
- spec/editor_spec.rb
|
@@ -266,6 +268,7 @@ test_files:
|
|
266
268
|
- spec/core_ext/hash/list_spec.rb
|
267
269
|
- spec/core_ext/hash/options_spec.rb
|
268
270
|
- spec/core_ext/shellwords/clean_spec.rb
|
271
|
+
- spec/core_ext/string/characterize_spec.rb
|
269
272
|
- spec/core_ext/string/underline_spec.rb
|
270
273
|
- spec/directory_finder_spec.rb
|
271
274
|
- spec/editor_spec.rb
|