simple_slug 0.3.2 → 0.3.3

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: 1e8cbeedf05abbf945614e72846da70ca8e21379
4
- data.tar.gz: 550eada3c913277bbe43a57d64a22d1215d3a483
3
+ metadata.gz: c874adc1930625e01a5acd27c1fe86702b83f165
4
+ data.tar.gz: 42c385427b5cd8f19414cc8f04425e0303d53cf6
5
5
  SHA512:
6
- metadata.gz: eab35d261a855fcfb5a95dd626a8faa3447dff6e65fd8f7dace62dbb3e0e16a6f3ed75b14b625bfdd256412ab3bc9a4708b00461c57c9f1401ff3394d9cc0a9b
7
- data.tar.gz: 973807508c775c94a059b437a7fc8afee529a2963113d3b65ff4fd561bf2feb58ba919be92646137e9b32dfea809bf91cf683ac9f6d611b6af53f956f0a01fc1
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
@@ -1,3 +1,3 @@
1
1
  module SimpleSlug
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
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('АаВЕеіКкМНОорСсТуХх', 'AaBEeiKkMHOopCcTyXx')
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.2
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-26 00:00:00.000000000 Z
11
+ date: 2016-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord