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 +4 -4
- data/lib/minislug/version.rb +1 -1
- data/lib/minislug.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 854b502b497a5832d250e18366bf7e64d4adce11372fbaec05ebf66dd0d765ba
|
4
|
+
data.tar.gz: ce51386d043306b0743480578b6e91d747b49767e860002d500efaefd250304c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72ee14bc912f6ae29dd7c3ea2f412d569700c40a1e9f1df6f628fefffd3e1f7e6bb2fea8e29a86079d7fc91105e37cb4dc3c3db8fbca018f3d3c323d1cd4e43c
|
7
|
+
data.tar.gz: 5eaf957f4e2dcb0536521cb206a8532e256ffb87c67279c3019c4469e629cbd4653cd1fe48cc81fc62f84a5cd33ec0dec9ad3b571dba1c3fc21ae98796f11c0c
|
data/lib/minislug/version.rb
CHANGED
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.
|
32
|
+
txt = txt.tr TR0, TR1
|
29
33
|
SUBSTITUTIONS.each do |reg, rep|
|
30
34
|
txt = txt.gsub reg, rep
|
31
35
|
end
|