slugify 1.0.6 → 1.0.7
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 +4 -4
- data/lib/slugify.rb +67 -1
- data/tests/slugify_test.rb +3 -1
- metadata +16 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f4a0ec3d25fc4351a0d63316d539eca3f01dada
|
4
|
+
data.tar.gz: 00257053fc10f53421dfb2126daddcf29361df40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b744606a3f29e667251133f64e4cb09e1981c23615f66ddfac8c349dc816b2a47ade0275f5ae950802b387eda02cd8a04ec82ef29d724dcb084e6fe732da738
|
7
|
+
data.tar.gz: 34209f242f303d47266a3499fa7e9dfae0d86c41207c50978ee05bf851ed440b58615fe0b2ea769107ebf76ecfa901d3b8adb1cf48727669dc0e542a1fb9073b
|
data/lib/slugify.rb
CHANGED
@@ -7,7 +7,7 @@ end
|
|
7
7
|
require File.dirname(__FILE__) + '/slugify_string'
|
8
8
|
|
9
9
|
class Slugify
|
10
|
-
|
10
|
+
|
11
11
|
SLUGGY_MAPPING = {
|
12
12
|
'0' => '0',
|
13
13
|
'1' => '1',
|
@@ -858,6 +858,72 @@ class Slugify
|
|
858
858
|
'ꜻ' => 'af',
|
859
859
|
'Ꜽ' => 'af',
|
860
860
|
'ꜽ' => 'af',
|
861
|
+
'А' => 'a',
|
862
|
+
'Б' => 'b',
|
863
|
+
'В' => 'v',
|
864
|
+
'Г' => 'g',
|
865
|
+
'Д' => 'd',
|
866
|
+
'Е' => 'ye',
|
867
|
+
'Ё' => 'yo',
|
868
|
+
'Ж' => 'zh',
|
869
|
+
'З' => 'z',
|
870
|
+
'И' => 'i',
|
871
|
+
'Й' => 'j',
|
872
|
+
'К' => 'k',
|
873
|
+
'Л' => 'l',
|
874
|
+
'М' => 'm',
|
875
|
+
'Н' => 'n',
|
876
|
+
'О' => 'o',
|
877
|
+
'П' => 'p',
|
878
|
+
'Р' => 'r',
|
879
|
+
'С' => 's',
|
880
|
+
'Т' => 't',
|
881
|
+
'У' => 'u',
|
882
|
+
'Ф' => 'f',
|
883
|
+
'Х' => 'h',
|
884
|
+
'Ц' => 'c',
|
885
|
+
'Ч' => 'ch',
|
886
|
+
'Ш' => 'sh',
|
887
|
+
'Щ' => 'shch',
|
888
|
+
'Ъ' => '',
|
889
|
+
'Ы' => 'y',
|
890
|
+
'Ь' => '',
|
891
|
+
'Э' => 'e',
|
892
|
+
'Ю' => 'yu',
|
893
|
+
'Я' => 'ya',
|
894
|
+
'а' => 'a',
|
895
|
+
'б' => 'b',
|
896
|
+
'в' => 'v',
|
897
|
+
'г' => 'g',
|
898
|
+
'д' => 'd',
|
899
|
+
'е' => 'ye',
|
900
|
+
'ё' => 'yo',
|
901
|
+
'ж' => 'zh',
|
902
|
+
'з' => 'z',
|
903
|
+
'и' => 'i',
|
904
|
+
'й' => 'j',
|
905
|
+
'к' => 'k',
|
906
|
+
'л' => 'l',
|
907
|
+
'м' => 'm',
|
908
|
+
'н' => 'n',
|
909
|
+
'о' => 'o',
|
910
|
+
'п' => 'p',
|
911
|
+
'р' => 'r',
|
912
|
+
'с' => 's',
|
913
|
+
'т' => 't',
|
914
|
+
'у' => 'u',
|
915
|
+
'ф' => 'f',
|
916
|
+
'х' => 'h',
|
917
|
+
'ц' => 'c',
|
918
|
+
'ч' => 'ch',
|
919
|
+
'ш' => 'sh',
|
920
|
+
'щ' => 'shch',
|
921
|
+
'ъ' => '',
|
922
|
+
'ы' => 'y',
|
923
|
+
'ь' => '',
|
924
|
+
'э' => 'e',
|
925
|
+
'ю' => 'yu',
|
926
|
+
'я' => 'ya',
|
861
927
|
'A' => 'a',
|
862
928
|
'B' => 'b',
|
863
929
|
'C' => 'c',
|
data/tests/slugify_test.rb
CHANGED
@@ -93,6 +93,8 @@ class SlugifyTest < Test::Unit::TestCase
|
|
93
93
|
assert_equal 'abcdefghijklmno', Slugify.convert('`abcdefghijklmno')
|
94
94
|
assert_equal 'pqrstuvwxyz-', Slugify.convert('pqrstuvwxyz{|}~')
|
95
95
|
|
96
|
+
assert_equal 'abvgdklmnzh', Slugify.convert('АБВГДклмнж')
|
97
|
+
|
96
98
|
assert_equal 'abcdefghijklmnopqrstuvwxyz', Slugify.convert('abcdefghijklmnopqrstuvwxyz')
|
97
99
|
assert_equal 'abcdefghijklmnopqrstuvwxyz', Slugify.convert('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
|
98
100
|
assert_equal '0123456789', Slugify.convert('0123456789')
|
@@ -111,4 +113,4 @@ class SlugifyTest < Test::Unit::TestCase
|
|
111
113
|
assert_equal 'test-test', Slugify.convert('-test--test-', true)
|
112
114
|
end
|
113
115
|
|
114
|
-
end
|
116
|
+
end
|
metadata
CHANGED
@@ -1,47 +1,48 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slugify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefaan Colman
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Adds a method slugify to the string class that converts the string to
|
14
|
-
|
13
|
+
description: Adds a method slugify to the string class that converts the string to
|
14
|
+
a slug
|
15
|
+
email:
|
15
16
|
executables: []
|
16
17
|
extensions: []
|
17
18
|
extra_rdoc_files: []
|
18
19
|
files:
|
19
|
-
-
|
20
|
+
- README
|
20
21
|
- lib/slugify.rb
|
21
|
-
-
|
22
|
+
- lib/slugify_string.rb
|
22
23
|
- tests/slugify_test.rb
|
23
|
-
-
|
24
|
-
homepage:
|
24
|
+
- tests/string_slugify_test.rb
|
25
|
+
homepage: https://github.com/Slicertje/Slugify
|
25
26
|
licenses: []
|
26
27
|
metadata: {}
|
27
|
-
post_install_message:
|
28
|
+
post_install_message:
|
28
29
|
rdoc_options: []
|
29
30
|
require_paths:
|
30
31
|
- lib
|
31
32
|
required_ruby_version: !ruby/object:Gem::Requirement
|
32
33
|
requirements:
|
33
|
-
- -
|
34
|
+
- - ">="
|
34
35
|
- !ruby/object:Gem::Version
|
35
36
|
version: '0'
|
36
37
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
|
-
- -
|
39
|
+
- - ">="
|
39
40
|
- !ruby/object:Gem::Version
|
40
41
|
version: '0'
|
41
42
|
requirements: []
|
42
|
-
rubyforge_project:
|
43
|
-
rubygems_version: 2.1
|
44
|
-
signing_key:
|
43
|
+
rubyforge_project:
|
44
|
+
rubygems_version: 2.4.5.1
|
45
|
+
signing_key:
|
45
46
|
specification_version: 4
|
46
47
|
summary: Adds String#slugify method
|
47
48
|
test_files:
|