to_slug 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- to_slug (1.0.0)
4
+ to_slug (1.0.4)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
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.each do |character|
80
- string = string.gsub(character, replacement)
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
@@ -1,3 +1,3 @@
1
1
  module ToSlug
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 4
9
- version: 1.0.4
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-02 00:00:00 -06:00
17
+ date: 2011-02-08 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency