permalink 1.1.1 → 1.1.2

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- permalink (1.1.1)
4
+ permalink (1.1.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -2,6 +2,7 @@ class String
2
2
  def to_permalink
3
3
  str = ActiveSupport::Multibyte::Chars.new(self)
4
4
  str = str.normalize(:kd).gsub(/[^\x00-\x7F]/,'').to_s
5
+ str.gsub!(/'/, "")
5
6
  str.gsub!(/[^-\w\d]+/sim, "-")
6
7
  str.gsub!(/-+/sm, "-")
7
8
  str.gsub!(/^-?(.*?)-?$/, '\1')
@@ -2,7 +2,7 @@ module Permalink
2
2
  module Version
3
3
  MAJOR = 1
4
4
  MINOR = 1
5
- PATCH = 1
5
+ PATCH = 2
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
@@ -9,8 +9,10 @@ describe "String#to_permalink" do
9
9
  '中文測試 chinese text' => 'chinese-text',
10
10
  'some-)()()-ExtRa!/// .data==?> to \/\/test' => 'some-extra-data-to-test',
11
11
  'http://simplesideias.com.br/tags/' => 'http-simplesideias-com-br-tags',
12
- "Don't Repeat Yourself (DRY)" => 'don-t-repeat-yourself-dry',
13
- "Text\nwith\nline\n\n\tbreaks" => 'text-with-line-breaks'
12
+ "Don't Repeat Yourself (DRY)" => 'dont-repeat-yourself-dry',
13
+ "Text\nwith\nline\n\n\tbreaks" => 'text-with-line-breaks',
14
+ "can't do it" => "cant-do-it",
15
+ "i'm a dog" => "im-a-dog"
14
16
  }
15
17
 
16
18
  it "should create permalink using to_permalink" do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: permalink
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.1
5
+ version: 1.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nando Vieira
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-11 00:00:00 -03:00
13
+ date: 2011-03-21 00:00:00 -03:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency