to_slug 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/to_slug/version.rb +1 -1
- data/lib/to_slug.rb +70 -23
- data/spec/to_slug_spec.rb +228 -1
- metadata +2 -2
data/lib/to_slug/version.rb
CHANGED
data/lib/to_slug.rb
CHANGED
@@ -5,48 +5,95 @@ class String # This reopns the string class
|
|
5
5
|
def to_slug
|
6
6
|
# This is the input as there are no arguments passed.
|
7
7
|
string = self
|
8
|
-
|
8
|
+
|
9
|
+
|
9
10
|
# Define which accents map to which ascii characters
|
10
11
|
accents = {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
12
|
+
'A' => %w(À Á Â Ã Ā Ă Ȧ Ả Ä Å Ǎ Ȁ Ȃ Ą Ạ Ḁ Ầ Ấ Ẫ Ẩ Ằ Ắ Ẵ Ẳ Ǡ Ǟ Ǻ Ậ Ặ),
|
13
|
+
'AE' => %w(Æ Ǽ Ǣ),
|
14
|
+
'B' => %w(ḂƁ Ḅ Ḇ Ƃ Ƅ),
|
15
|
+
'C' => %w(C Ć Ĉ Ċ Č Ƈ Ç Ḉ),
|
16
|
+
'D' => %w(D Ḋ Ɗ Ḍ Ḏ Ḑ Ḓ Ď Đ Ɖ Ƌ),
|
17
|
+
'E' => %w(È É Ê Ẽ Ē Ĕ Ė Ë Ẻ Ě Ȅ Ȇ Ẹ Ȩ Ę Ḙ Ḛ Ề Ế Ễ Ể Ḕ Ḗ Ệ Ḝ Ǝ Ɛ),
|
18
|
+
'F' => %w(Ḟ Ƒ),
|
19
|
+
'G' => %w(Ǵ Ĝ Ḡ Ğ Ġ Ǧ Ɠ Ģ Ǥ),
|
20
|
+
'H' => %w(Ĥ Ḣ Ḧ Ȟ Ƕ Ḥ Ḩ Ḫ Ħ),
|
21
|
+
'I' => %w(Ì Í Î Ĩ Ī Ĭ İ Ï Ỉ Ǐ Ị Į Ȉ Ȋ Ḭ Ɨ Ḯ),
|
22
|
+
'IJ' => %w(IJ),
|
23
|
+
'J' => %w(Ĵ),
|
24
|
+
'K' => %w(Ḱ Ǩ Ḵ Ƙ Ḳ Ķ),
|
25
|
+
'L' => %w(Ĺ Ḻ Ḷ Ļ Ḽ Ľ Ŀ Ł Ḹ),
|
26
|
+
'M' => %w(Ḿ Ṁ Ṃ Ɯ),
|
27
|
+
'N' => %w(Ǹ Ń Ñ Ṅ Ň Ŋ Ɲ Ṇ Ņ Ṋ Ṉ Ƞ),
|
28
|
+
'O' => %w(Ò Ó Ô Õ Ō Ŏ Ȯ Ö Ỏ Ő Ǒ Ȍ Ȏ Ơ Ǫ Ọ Ɵ Ø Ồ Ố Ỗ Ổ Ȱ Ȫ Ȭ Ṍ Ṏ Ṑ Ṓ Ờ Ớ Ỡ Ở Ợ Ǭ Ộ Ǿ Ɔ),
|
29
|
+
'OE' => %w(Œ),
|
30
|
+
'P' => %w(Ṕ Ṗ Ƥ),
|
31
|
+
'R' => %w(Ŕ Ṙ Ř Ȑ Ȓ Ṛ Ŗ Ṟ Ṝ Ʀ),
|
32
|
+
'S' => %w(Ś Ŝ Ṡ Š Ṣ Ș Ş Ṥ Ṧ Ṩ),
|
33
|
+
'T' => %w(Ṫ Ť Ƭ Ʈ Ṭ Ț Ţ Ṱ Ṯ Ŧ),
|
34
|
+
'U' => %w(Ù Ú Û Ũ Ū Ŭ Ü Ủ Ů Ű Ǔ Ȕ Ȗ Ư Ụ Ṳ Ų Ṷ Ṵ Ṹ Ṻ Ǜ Ǘ Ǖ Ǚ Ừ Ứ Ữ Ử Ự),
|
35
|
+
'V' => %w(Ṽ Ṿ Ʋ),
|
36
|
+
'W' => %w(Ẁ Ẃ Ŵ Ẇ Ẅ Ẉ),
|
37
|
+
'X' => %w(Ẋ Ẍ),
|
38
|
+
'Y' => %w(Ỳ Ý Ŷ Ỹ Ȳ Ẏ Ÿ Ỷ Ƴ Ỵ),
|
39
|
+
'Z' => %w(Ź Ẑ Ż Ž Ȥ Ẓ Ẕ Ƶ),
|
40
|
+
|
41
|
+
'a' => %w(à á â ã ā ă ȧ ä ả å ǎ ȁ ȃ ą ạ ḁ ẚ ầ ấ ẫ ẩ ằ ắ ẵ ẳ ǡ ǟ ǻ ậ ặ),
|
42
|
+
'ae' => %w(æ ǽ ǣ),
|
43
|
+
'b' => %w(ḃ ɓ ḅ ḇ ƀ ƃ ƅ),
|
44
|
+
'c' => %w(ć ĉ ċ č ƈ ç ḉ),
|
45
|
+
'd' => %w(ḋ ɗ ḍ ḏ ḑ ḓ ď đ ƌ ȡ),
|
46
|
+
'e' => %w(è é ê ẽ ē ĕ ė ë ẻ ě ȅ ȇ ẹ ȩ ę ḙ ḛ ề ế ễ ể ḕ ḗ ệ ḝ ɛ),
|
47
|
+
'f' => %w(ḟ ƒ),
|
48
|
+
'g' => %w(ǵ ĝ ḡ ğ ġ ǧ ɠ ģ ǥ),
|
49
|
+
'h' => %w(ĥ ḣ ḧ ȟ ƕ ḩ ḫ ẖ ħ),
|
50
|
+
'i' => %w(ì í î ĩ ī ĭ ı ï ỉ ǐ į į ȋ ḭ ɨ ḯ),
|
51
|
+
'ij' => %w(ij),
|
52
|
+
'j' => %w(ĵ ǰ),
|
53
|
+
'k' => %w(ḱ ǩ ƙ ḳ ķ),
|
54
|
+
'l' => %w(ĺ ḻ ḷ ļ ḽ ľ ŀ ł ƚ ḹ ȴ),
|
55
|
+
'm' => %w(ḿ ṁ ṃ ɯ),
|
56
|
+
'n' => %w(ǹ ń ñ ṅ ň ŋ ɲ ṇ ņ ṋ ṉ ʼn ȵ),
|
57
|
+
'o' => %w(ò ó ô õ ō ŏ ȯ ö ỏ ő ǒ ȍ ȏ ơ ǫ ọ ɵ ø ồ ố ỗ ổ ȱ ȫ ȭ ṍ ṏ ṑ ṓ ờ ớ ỡ ở ợ ǭ ộ ǿ ɔ),
|
58
|
+
'oe' => %w(œ),
|
59
|
+
'p' => %w(ṕ ṗ ƥ),
|
60
|
+
'r' => %w(ŕ ṙ ř ȑ ȓ ṛ ŗ ṟ ṝ),
|
61
|
+
's' => %w(ś ŝ ṡ š ṣ ș ş ṥ ṧ ṩ ß ſ ẛ),
|
62
|
+
't' => %w(ṫ ẗ ť ƭ ʈ ƫ ṭ ț ţ ṱ ṯ ŧ ȶ),
|
63
|
+
'u' => %w(ù ú û ũ ū ŭ ü ủ ů ű ǔ ȕ ȗ ư ụ ṳ ų ṷ ṵ ṹ ṻ ǖ ǜ ǘ ǖ ǚ ừ ứ ữ ử ự),
|
64
|
+
'v' => %w(ṽ ṿ),
|
65
|
+
'w' => %w(ẁ ẃ ŵ ẇ ẅ ẘ ẉ),
|
66
|
+
'x' => %w(ẋ ẍ),
|
67
|
+
'y' => %w(ỳ ý ŷ ỹ ȳ ẏ ÿ ỷ ẙ ƴ ỵ),
|
68
|
+
'z' => %w(ź ẑ ż ž ȥ ẓ ẕ ƶ),
|
69
|
+
'' => %w(Ð Þ Ə Ɣ Ɩ Ƣ Ƨ Ʃ Ʊ Ʒ Ǯ Ƹ Ȝ ƿ Ȣ ð þ ə ɣ ɩ ƣ ƨ ʃ ƪ ʊ ʒ ǯ ƹ ƺ ȝ Ƿ ȣ DZ Dz dz DŽ Dž dž LJ Lj lj NJ Nj nj ĸ ƍ ƛ ƾ ƻ Ƽ ƽ)
|
24
70
|
}
|
25
|
-
|
71
|
+
|
72
|
+
|
26
73
|
# Replace each accent in the string
|
27
|
-
accents.each do |
|
74
|
+
accents.each do |replacement, accent|
|
28
75
|
accent.each do |character|
|
29
76
|
string = string.gsub(character, replacement)
|
30
77
|
end
|
31
78
|
end
|
32
|
-
|
79
|
+
|
33
80
|
# Convert underscores to dashs
|
34
81
|
string = string.gsub(/[_]/,"-")
|
35
|
-
|
82
|
+
|
36
83
|
# Remove any characters that aren't alphanumeric (or a dash)
|
37
84
|
string = string.gsub(/[^a-zA-Z0-9 \-]/,"")
|
38
|
-
|
85
|
+
|
39
86
|
# Convert multiple spaces to a single space
|
40
87
|
string = string.gsub(/[ ]+/," ")
|
41
|
-
|
88
|
+
|
42
89
|
# Give a little trim around the edges (leading/trailing whitespace)
|
43
90
|
string.strip!
|
44
|
-
|
91
|
+
|
45
92
|
# Replace single spaces with a URL friendly dash (-)
|
46
93
|
string = string.gsub(/ /,"-")
|
47
|
-
|
94
|
+
|
48
95
|
# CASE. EVERYTHING. DOWN. (and return since it's the last line)
|
49
96
|
string = string.downcase
|
50
|
-
|
97
|
+
|
51
98
|
end
|
52
99
|
end
|
data/spec/to_slug_spec.rb
CHANGED
@@ -5,7 +5,7 @@ require 'to_slug'
|
|
5
5
|
describe String, "to_slug" do
|
6
6
|
|
7
7
|
it "replaces spaces with dashes" do
|
8
|
-
"This is a string".to_slug == "this-is-a-string"
|
8
|
+
"This is a string".to_slug.should == "this-is-a-string"
|
9
9
|
end
|
10
10
|
|
11
11
|
it "converts accented characters to a close ASCII alternative" do
|
@@ -59,5 +59,232 @@ describe String, "to_slug" do
|
|
59
59
|
it "remains a String class" do
|
60
60
|
"I am a string class yo!".to_slug.should be_kind_of(String)
|
61
61
|
end
|
62
|
+
|
63
|
+
# Test all the accents
|
64
|
+
|
65
|
+
it "converts accents for the letter A" do
|
66
|
+
"À Á Â Ã Ā Ă Ȧ Ả Ä Å Ǎ Ȁ Ȃ Ą Ạ Ḁ Ầ Ấ Ẫ Ẩ Ằ Ắ Ẵ Ẳ Ǡ Ǟ Ǻ Ậ Ặ".to_slug.should == "a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a"
|
67
|
+
end
|
68
|
+
|
69
|
+
it "converts accents for the letter AE" do
|
70
|
+
"Æ Ǽ Ǣ".to_slug.should == "ae-ae-ae"
|
71
|
+
end
|
72
|
+
|
73
|
+
it "converts accents for the letter B" do
|
74
|
+
"ḂƁ Ḅ Ḇ Ƃ Ƅ".to_slug.should == "b-b-b-b-b"
|
75
|
+
end
|
76
|
+
|
77
|
+
it "converts accents for the letter C" do
|
78
|
+
"C Ć Ĉ Ċ Č Ƈ Ç Ḉ".to_slug.should == "c-c-c-c-c-c-c-c"
|
79
|
+
end
|
80
|
+
|
81
|
+
it "converts accents for the letter D" do
|
82
|
+
"D Ḋ Ɗ Ḍ Ḏ Ḑ Ḓ Ď Đ Ɖ Ƌ".to_slug.should == "d-d-d-d-d-d-d-d-d-d-d"
|
83
|
+
end
|
84
|
+
|
85
|
+
it "converts accents for the letter E" do
|
86
|
+
"È É Ê Ẽ Ē Ĕ Ė Ë Ẻ Ě Ȅ Ȇ Ẹ Ȩ Ę Ḙ Ḛ Ề Ế Ễ Ể Ḕ Ḗ Ệ Ḝ Ǝ Ɛ".to_slug.should == "e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e"
|
87
|
+
end
|
88
|
+
|
89
|
+
it "converts accents for the letter F" do
|
90
|
+
"Ḟ Ƒ".to_slug.should == "f-f"
|
91
|
+
end
|
92
|
+
|
93
|
+
it "converts accents for the letter G" do
|
94
|
+
"Ǵ Ĝ Ḡ Ğ Ġ Ǧ Ɠ Ģ Ǥ".to_slug.should == "g-g-g-g-g-g-g-g-g"
|
95
|
+
end
|
96
|
+
|
97
|
+
it "converts accents for the letter H" do
|
98
|
+
"Ĥ Ḣ Ḧ Ȟ Ƕ Ḥ Ḩ Ḫ Ħ".to_slug.should == "h-h-h-h-h-h-h-h-h"
|
99
|
+
end
|
100
|
+
|
101
|
+
it "converts accents for the letter I" do
|
102
|
+
"Ì Í Î Ĩ Ī Ĭ İ Ï Ỉ Ǐ Ị Į Ȉ Ȋ Ḭ Ɨ Ḯ".to_slug.should == "i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i"
|
103
|
+
end
|
104
|
+
|
105
|
+
it "converts accents for the letter IJ" do
|
106
|
+
"IJ".to_slug.should == "ij"
|
107
|
+
end
|
108
|
+
|
109
|
+
it "converts accents for the letter J" do
|
110
|
+
"Ĵ".to_slug.should == "j"
|
111
|
+
end
|
112
|
+
|
113
|
+
it "converts accents for the letter K" do
|
114
|
+
"Ḱ Ǩ Ḵ Ƙ Ḳ Ķ".to_slug.should == "k-k-k-k-k-k"
|
115
|
+
end
|
116
|
+
|
117
|
+
it "converts accents for the letter L" do
|
118
|
+
"Ĺ Ḻ Ḷ Ļ Ḽ Ľ Ŀ Ł Ḹ".to_slug.should == "l-l-l-l-l-l-l-l-l"
|
119
|
+
end
|
120
|
+
|
121
|
+
it "converts accents for the letter M" do
|
122
|
+
"Ḿ Ṁ Ṃ Ɯ".to_slug.should == "m-m-m-m"
|
123
|
+
end
|
124
|
+
|
125
|
+
it "converts accents for the letter N" do
|
126
|
+
"Ǹ Ń Ñ Ṅ Ň Ŋ Ɲ Ṇ Ņ Ṋ Ṉ Ƞ".to_slug.should == "n-n-n-n-n-n-n-n-n-n-n-n"
|
127
|
+
end
|
128
|
+
|
129
|
+
it "converts accents for the letter O" do
|
130
|
+
"Ò Ó Ô Õ Ō Ŏ Ȯ Ö Ỏ Ő Ǒ Ȍ Ȏ Ơ Ǫ Ọ Ɵ Ø Ồ Ố Ỗ Ổ Ȱ Ȫ Ȭ Ṍ Ṏ Ṑ Ṓ Ờ Ớ Ỡ Ở Ợ Ǭ Ộ Ǿ Ɔ".to_slug.should == "o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o"
|
131
|
+
end
|
132
|
+
|
133
|
+
it "converts accents for the letter OE" do
|
134
|
+
"Œ".to_slug.should == "oe"
|
135
|
+
end
|
136
|
+
|
137
|
+
it "converts accents for the letter P" do
|
138
|
+
"Ṕ Ṗ Ƥ".to_slug.should == "p-p-p"
|
139
|
+
end
|
140
|
+
|
141
|
+
it "converts accents for the letter R" do
|
142
|
+
"Ŕ Ṙ Ř Ȑ Ȓ Ṛ Ŗ Ṟ Ṝ Ʀ".to_slug.should == "r-r-r-r-r-r-r-r-r-r"
|
143
|
+
end
|
144
|
+
|
145
|
+
it "converts accents for the letter S" do
|
146
|
+
"Ś Ŝ Ṡ Š Ṣ Ș Ş Ṥ Ṧ Ṩ".to_slug.should == "s-s-s-s-s-s-s-s-s-s"
|
147
|
+
end
|
148
|
+
|
149
|
+
it "converts accents for the letter T" do
|
150
|
+
"Ṫ Ť Ƭ Ʈ Ṭ Ț Ţ Ṱ Ṯ Ŧ".to_slug.should == "t-t-t-t-t-t-t-t-t-t"
|
151
|
+
end
|
152
|
+
|
153
|
+
it "converts accents for the letter U" do
|
154
|
+
"Ù Ú Û Ũ Ū Ŭ Ü Ủ Ů Ű Ǔ Ȕ Ȗ Ư Ụ Ṳ Ų Ṷ Ṵ Ṹ Ṻ Ǜ Ǘ Ǖ Ǚ Ừ Ứ Ữ Ử Ự".to_slug.should == "u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u"
|
155
|
+
end
|
156
|
+
|
157
|
+
it "converts accents for the letter V" do
|
158
|
+
"Ṽ Ṿ Ʋ".to_slug.should == "v-v-v"
|
159
|
+
end
|
160
|
+
|
161
|
+
it "converts accents for the letter W" do
|
162
|
+
"Ẁ Ẃ Ŵ Ẇ Ẅ Ẉ".to_slug.should == "w-w-w-w-w-w"
|
163
|
+
end
|
164
|
+
|
165
|
+
it "converts accents for the letter X" do
|
166
|
+
"Ẋ Ẍ".to_slug.should == "x-x"
|
167
|
+
end
|
168
|
+
|
169
|
+
it "converts accents for the letter Y" do
|
170
|
+
"Ỳ Ý Ŷ Ỹ Ȳ Ẏ Ÿ Ỷ Ƴ Ỵ".to_slug.should == "y-y-y-y-y-y-y-y-y-y"
|
171
|
+
end
|
172
|
+
|
173
|
+
it "converts accents for the letter Z" do
|
174
|
+
"Ź Ẑ Ż Ž Ȥ Ẓ Ẕ Ƶ".to_slug.should == "z-z-z-z-z-z-z-z"
|
175
|
+
end
|
62
176
|
|
177
|
+
it "converts accents for the letter a" do
|
178
|
+
"à á â ã ā ă ȧ ä ả å ǎ ȁ ȃ ą ạ ḁ ẚ ầ ấ ẫ ẩ ằ ắ ẵ ẳ ǡ ǟ ǻ ậ ặ".to_slug.should == "a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a"
|
179
|
+
end
|
180
|
+
|
181
|
+
it "converts accents for the letter ae" do
|
182
|
+
"æ ǽ ǣ".to_slug.should == "ae-ae-ae"
|
183
|
+
end
|
184
|
+
|
185
|
+
it "converts accents for the letter b" do
|
186
|
+
"ḃ ɓ ḅ ḇ ƀ ƃ ƅ".to_slug.should == "b-b-b-b-b-b-b"
|
187
|
+
end
|
188
|
+
|
189
|
+
it "converts accents for the letter c" do
|
190
|
+
"ć ĉ ċ č ƈ ç ḉ".to_slug.should == "c-c-c-c-c-c-c"
|
191
|
+
end
|
192
|
+
|
193
|
+
it "converts accents for the letter d" do
|
194
|
+
"ḋ ɗ ḍ ḏ ḑ ḓ ď đ ƌ ȡ".to_slug.should == "d-d-d-d-d-d-d-d-d-d"
|
195
|
+
end
|
196
|
+
|
197
|
+
it "converts accents for the letter e" do
|
198
|
+
"è é ê ẽ ē ĕ ė ë ẻ ě ȅ ȇ ẹ ȩ ę ḙ ḛ ề ế ễ ể ḕ ḗ ệ ḝ ɛ".to_slug.should == "e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e-e"
|
199
|
+
end
|
200
|
+
|
201
|
+
it "converts accents for the letter f" do
|
202
|
+
"ḟ ƒ".to_slug.should == "f-f"
|
203
|
+
end
|
204
|
+
|
205
|
+
it "converts accents for the letter g" do
|
206
|
+
"ǵ ĝ ḡ ğ ġ ǧ ɠ ģ ǥ".to_slug.should == "g-g-g-g-g-g-g-g-g"
|
207
|
+
end
|
208
|
+
|
209
|
+
it "converts accents for the letter h" do
|
210
|
+
"ĥ ḣ ḧ ȟ ƕ ḩ ḫ ẖ ħ".to_slug.should == "h-h-h-h-h-h-h-h-h"
|
211
|
+
end
|
212
|
+
|
213
|
+
it "converts accents for the letter i" do
|
214
|
+
"ì í î ĩ ī ĭ ı ï ỉ ǐ į į ȋ ḭ ɨ ḯ".to_slug.should == "i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i"
|
215
|
+
end
|
216
|
+
|
217
|
+
it "converts accents for the letter ij" do
|
218
|
+
"ij".to_slug.should == "ij"
|
219
|
+
end
|
220
|
+
|
221
|
+
it "converts accents for the letter j" do
|
222
|
+
"ĵ ǰ".to_slug.should == "j-j"
|
223
|
+
end
|
224
|
+
|
225
|
+
it "converts accents for the letter k" do
|
226
|
+
"ḱ ǩ ƙ ḳ ķ".to_slug.should == "k-k-k-k-k"
|
227
|
+
end
|
228
|
+
|
229
|
+
it "converts accents for the letter l" do
|
230
|
+
"ĺ ḻ ḷ ļ ḽ ľ ŀ ł ƚ ḹ ȴ".to_slug.should == "l-l-l-l-l-l-l-l-l-l-l"
|
231
|
+
end
|
232
|
+
|
233
|
+
it "converts accents for the letter m" do
|
234
|
+
"ḿ ṁ ṃ ɯ".to_slug.should == "m-m-m-m"
|
235
|
+
end
|
236
|
+
|
237
|
+
it "converts accents for the letter n" do
|
238
|
+
"ǹ ń ñ ṅ ň ŋ ɲ ṇ ņ ṋ ṉ ʼn ȵ".to_slug.should == "n-n-n-n-n-n-n-n-n-n-n-n-n"
|
239
|
+
end
|
240
|
+
|
241
|
+
it "converts accents for the letter o" do
|
242
|
+
"ò ó ô õ ō ŏ ȯ ö ỏ ő ǒ ȍ ȏ ơ ǫ ọ ɵ ø ồ ố ỗ ổ ȱ ȫ ȭ ṍ ṏ ṑ ṓ ờ ớ ỡ ở ợ ǭ ộ ǿ ɔ".to_slug.should == "o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o"
|
243
|
+
end
|
244
|
+
|
245
|
+
it "converts accents for the letter oe" do
|
246
|
+
"œ".to_slug.should == "oe"
|
247
|
+
end
|
248
|
+
|
249
|
+
it "converts accents for the letter p" do
|
250
|
+
"ṕ ṗ ƥ".to_slug.should == "p-p-p"
|
251
|
+
end
|
252
|
+
|
253
|
+
it "converts accents for the letter r" do
|
254
|
+
"ŕ ṙ ř ȑ ȓ ṛ ŗ ṟ ṝ".to_slug.should == "r-r-r-r-r-r-r-r-r"
|
255
|
+
end
|
256
|
+
|
257
|
+
it "converts accents for the letter s" do
|
258
|
+
"ś ŝ ṡ š ṣ ș ş ṥ ṧ ṩ ß ſ ẛ".to_slug.should == "s-s-s-s-s-s-s-s-s-s-s-s-s"
|
259
|
+
end
|
260
|
+
|
261
|
+
it "converts accents for the letter t" do
|
262
|
+
"ṫ ẗ ť ƭ ʈ ƫ ṭ ț ţ ṱ ṯ ŧ ȶ".to_slug.should == "t-t-t-t-t-t-t-t-t-t-t-t-t"
|
263
|
+
end
|
264
|
+
|
265
|
+
it "converts accents for the letter u" do
|
266
|
+
"ù ú û ũ ū ŭ ü ủ ů ű ǔ ȕ ȗ ư ụ ṳ ų ṷ ṵ ṹ ṻ ǖ ǜ ǘ ǖ ǚ ừ ứ ữ ử ự".to_slug.should == "u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u"
|
267
|
+
end
|
268
|
+
|
269
|
+
it "converts accents for the letter v" do
|
270
|
+
"ṽ ṿ".to_slug.should == "v-v"
|
271
|
+
end
|
272
|
+
|
273
|
+
it "converts accents for the letter w" do
|
274
|
+
"ẁ ẃ ŵ ẇ ẅ ẘ ẉ".to_slug.should == "w-w-w-w-w-w-w"
|
275
|
+
end
|
276
|
+
|
277
|
+
it "converts accents for the letter x" do
|
278
|
+
"ẋ ẍ".to_slug.should == "x-x"
|
279
|
+
end
|
280
|
+
|
281
|
+
it "converts accents for the letter y" do
|
282
|
+
"ỳ ý ŷ ỹ ȳ ẏ ÿ ỷ ẙ ƴ ỵ".to_slug.should == "y-y-y-y-y-y-y-y-y-y-y"
|
283
|
+
end
|
284
|
+
|
285
|
+
it "converts accents for the letter z" do
|
286
|
+
"ź ẑ ż ž ȥ ẓ ẕ ƶ".to_slug.should == "z-z-z-z-z-z-z-z"
|
287
|
+
end
|
288
|
+
|
289
|
+
|
63
290
|
end
|