fedux_org-stdlib 0.10.0 → 0.10.1

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: 142074fe00300790fa28656899176829d9e6e60b
4
- data.tar.gz: 9052f89fe52d1d5226a6ebcad78e37513dcb8858
3
+ metadata.gz: 0ab7864317eba3f95f3e9471b7ff3647220ef3fc
4
+ data.tar.gz: 3d7c27a31e36b1c53343d0ca0b82dd189af103c9
5
5
  SHA512:
6
- metadata.gz: 9df9eae8d9e2e5cb8f07ef3cec90f98618e70aea181116099c265a4d290c526b856f26c89719a783908093fbf804d53aad98b301e567f9bb5d3cb5c335719909
7
- data.tar.gz: 60bdbdcef44d8c1fdad4792021ba98b1b2eb445d6d6b69bbef6a53427508894d7c41348243936b924262a294305aab47e8c6e5071ed7365dd6ca1d46c4e79308
6
+ metadata.gz: 49b2c656b0ed717f547dd69883f5f0b5c948c6dc6ac00155395baca831599442b4480b309d25619bb387c450b08518275c4d5232c61b60ae7de011eb231cc3af
7
+ data.tar.gz: f4498bbefde2c432ac77ecc27bc4e2ed8c4daa81e5144e959e319afbe319ff25279d9f68409fa8cc19e0e055c76a55a34c095717963bce1c365963bc478c1473
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fedux_org-stdlib (0.10.0)
4
+ fedux_org-stdlib (0.10.1)
5
5
  activesupport
6
6
 
7
7
  PATH
@@ -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
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  # FeduxOrgStdlib
3
3
  module FeduxOrgStdlib
4
- VERSION = '0.10.0'
4
+ VERSION = '0.10.1'
5
5
  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.0
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