simple_slug 0.3.2 → 0.3.3
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/simple_slug/model_addition.rb +1 -1
- data/lib/simple_slug/version.rb +1 -1
- data/lib/simple_slug.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c874adc1930625e01a5acd27c1fe86702b83f165
|
4
|
+
data.tar.gz: 42c385427b5cd8f19414cc8f04425e0303d53cf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4509499086e9cd6a8f56d41861c1a83328be626ba89edea4e2a0599f729a81b6345d43064515f16f7d4aee395fceb519878b356470bf44f46051f15c60bd91a
|
7
|
+
data.tar.gz: e43c614e9f37982a6a7b6a8eec8897161ca097093dade94674e7661cc5655b748b0333301137ecd89fb2860dcdc61a8393b7fa5e9729bf6f54c02bb7f1ae1c34
|
@@ -100,7 +100,7 @@ module SimpleSlug
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def simple_slug_normalize(base)
|
103
|
-
base = SimpleSlug.normalize_cyrillic(base)
|
103
|
+
base = SimpleSlug.normalize_cyrillic(base) unless SimpleSlug::CYRILLIC_LOCALES.include?(I18n.locale)
|
104
104
|
parameterize_args = ActiveSupport::VERSION::MAJOR > 4 ? {separator: '-'} : '-'
|
105
105
|
normalized = I18n.transliterate(base).parameterize(parameterize_args).downcase
|
106
106
|
normalized.to_s =~ SimpleSlug::STARTS_WITH_NUMBER_REGEXP ? "_#{normalized}" : normalized
|
data/lib/simple_slug/version.rb
CHANGED
data/lib/simple_slug.rb
CHANGED
@@ -25,12 +25,13 @@ module SimpleSlug
|
|
25
25
|
@@add_validation = true
|
26
26
|
|
27
27
|
STARTS_WITH_NUMBER_REGEXP =/\A\d+/
|
28
|
+
CYRILLIC_LOCALES = [:uk, :ru, :be].freeze
|
28
29
|
|
29
30
|
def self.setup
|
30
31
|
yield self
|
31
32
|
end
|
32
33
|
|
33
34
|
def self.normalize_cyrillic(base)
|
34
|
-
base.tr('
|
35
|
+
base.tr('АаВЕеіКкМНОоРрСсТуХх', 'AaBEeiKkMHOoPpCcTyXx')
|
35
36
|
end
|
36
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_slug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Leschenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|