minislug 0.0.3 → 0.0.4

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
  SHA256:
3
- metadata.gz: f9dd973331cf76363e6cb94a04d80f58036b06045619c28ebccb4997e6e3e554
4
- data.tar.gz: 1043a0f409aac1df9b0a9f103fc90ff397905102f0dc73625663a599dc7c4881
3
+ metadata.gz: 854b502b497a5832d250e18366bf7e64d4adce11372fbaec05ebf66dd0d765ba
4
+ data.tar.gz: ce51386d043306b0743480578b6e91d747b49767e860002d500efaefd250304c
5
5
  SHA512:
6
- metadata.gz: 590423c43d141bfbafa8eb3ce2f13e830cd5c62aa85fc698592b2cefabb9bf0cd3cd19d88525f36d3a994c68451e3317e45ea0b28e6c88c7110c9706b29a0a62
7
- data.tar.gz: fb497ce04086498a6672c46e3bf66bec74bb751b9b4215d84901ed641b52ef37828edf7b715ac1f3c46965264739b7729c58c75021245e5b4aa203e71a460562
6
+ metadata.gz: 72ee14bc912f6ae29dd7c3ea2f412d569700c40a1e9f1df6f628fefffd3e1f7e6bb2fea8e29a86079d7fc91105e37cb4dc3c3db8fbca018f3d3c323d1cd4e43c
7
+ data.tar.gz: 5eaf957f4e2dcb0536521cb206a8532e256ffb87c67279c3019c4469e629cbd4653cd1fe48cc81fc62f84a5cd33ec0dec9ad3b571dba1c3fc21ae98796f11c0c
@@ -1,3 +1,3 @@
1
1
  module Minislug
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/minislug.rb CHANGED
@@ -10,6 +10,9 @@ module Minislug
10
10
  /-+/ => '-',
11
11
  }
12
12
 
13
+ TR0 = "ÀÁÂÃÄÅàáâãäåĀāĂ㥹ạảÇçĆćĈĉĊċČčÐðĎďĐđÈÉÊËèéêểệễëĒēĔĕĖėĘęĚěẹĜĝĞğĠġĢģĤĥĦħÌÍÎÏìíîïĨĩĪīĬĭĮįİıịỉĴĵĶķĸĹĺĻļĽľĿŀŁłÑñŃńŅņŇňʼnŊŋÒÓÔÕÖØòóôộỗổõöøŌōŎŏŐőọỏơởợỡŔŕŖŗŘřŚśŜŝŞşŠšſŢţŤťŦŧÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųụưủửữựŴŵÝýÿŶŷŸŹźŻżŽžứừửựữốồộỗổờóợỏỡếềễểệẩẫấầậỳỹýỷỵặẵẳằắ"
14
+ TR1 = "AAAAAAaaaaaaAaAaAaaaCcCcCcCcCcDdDdDdEEEEeeeeeeEeEeEeEeEeeGgGgGgGgHhHhhIIIiiiiIiIiIiIiIiiiJjKkkLlLlLlLlLlNnNnNnNnnNnOOOOOOoooooooooOoOoOooooooooRrRrRrSsSsSsSsTtTtTttUUUUuuuuUuUuUuUuUuUuuuuuuuWwYyyYyYZzZzZzuuuuuooooooooooeeeeeaaaaayyyyyaaaaa"
15
+
13
16
  module ClassMethods
14
17
  def sluggable source
15
18
  class_attribute :slug_source
@@ -23,9 +26,10 @@ module Minislug
23
26
  end
24
27
  end
25
28
 
29
+
26
30
  def self.convert_to_slug txt
27
31
  txt = txt.gsub(/ß/, "ss")
28
- txt = txt.strip.mb_chars.normalize(:kd)
32
+ txt = txt.tr TR0, TR1
29
33
  SUBSTITUTIONS.each do |reg, rep|
30
34
  txt = txt.gsub reg, rep
31
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minislug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Conan Dalton