to_slug 1.0.4 → 1.0.5
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.
- data/Gemfile.lock +1 -1
- data/lib/to_slug.rb +8 -3
- data/lib/to_slug/version.rb +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/lib/to_slug.rb
CHANGED
@@ -75,10 +75,15 @@ class String # This reopns the string class
|
|
75
75
|
|
76
76
|
|
77
77
|
# Replace each accent in the string
|
78
|
+
#accents.each do |replacement, accent|
|
79
|
+
# accent.each do |character|
|
80
|
+
# string = string.gsub(character, replacement)
|
81
|
+
# end
|
82
|
+
#end
|
83
|
+
|
78
84
|
accents.each do |replacement, accent|
|
79
|
-
accent.
|
80
|
-
|
81
|
-
end
|
85
|
+
regex = Regexp.new("[#{accent.join("|")}]")
|
86
|
+
string = string.gsub(regex, replacement)
|
82
87
|
end
|
83
88
|
|
84
89
|
# Convert underscores to dashs
|
data/lib/to_slug/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 5
|
9
|
+
version: 1.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Eric Boehs
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-02-
|
17
|
+
date: 2011-02-08 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|