slug 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 6
2
+ :patch: 7
3
3
  :major: 0
4
4
  :minor: 5
data/lib/slug/slug.rb CHANGED
@@ -78,7 +78,7 @@ module Slug
78
78
  s = ActiveSupport::Multibyte.proxy_class.new(self[self.slug_column]).normalize(:kc)
79
79
  s.downcase!
80
80
  s.strip!
81
- s.gsub!(/[^\w\s-]/, '') # Remove non-word characters
81
+ s.gsub!(/[^a-z0-9\s-]/, '') # Remove non-word characters
82
82
  s.gsub!(/\s+/, '-') # Convert whitespaces to dashes
83
83
  s.gsub!(/-\z/, '') # Remove trailing dashes
84
84
  s.gsub!(/-+/, '-') # get rid of double-dashes
data/slug.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{slug}
8
- s.version = "0.5.6"
8
+ s.version = "0.5.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben Koski"]
12
- s.date = %q{2010-06-24}
12
+ s.date = %q{2010-06-25}
13
13
  s.description = %q{Simple, straightforward slugs for your ActiveRecord models.}
14
14
  s.email = %q{ben.koski@gmail.com}
15
15
  s.extra_rdoc_files = [
data/test/test_slug.rb CHANGED
@@ -142,7 +142,7 @@ class TestSlug < Test::Unit::TestCase
142
142
  end
143
143
 
144
144
  should "should remove punctuation" do
145
- @article.headline = 'abc!@#$%^&*•¶§∞¢££¡¿()><?"":;][]\.,/'
145
+ @article.headline = 'abc!@#$%^&*•¶§∞¢££¡¿()><?""\':;][]\.,/'
146
146
  @article.save!
147
147
  assert_match 'abc', @article.slug
148
148
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Koski
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-06-24 00:00:00 -04:00
12
+ date: 2010-06-25 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency