friendly_id 2.1.2 → 2.1.3
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.tar.gz.sig +0 -0
- data/History.txt +5 -0
- data/Manifest.txt +1 -0
- data/friendly_id.gemspec +3 -4
- data/lib/friendly_id/slug.rb +1 -1
- data/lib/friendly_id/version.rb +1 -1
- data/test/models/event.rb +3 -0
- data/test/schema.rb +5 -0
- data/test/slugged_model_test.rb +4 -0
- data/test/test_helper.rb +1 -0
- metadata +3 -2
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/friendly_id.gemspec
CHANGED
@@ -2,15 +2,14 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{friendly_id}
|
5
|
-
s.version = "2.1.
|
6
|
-
|
5
|
+
s.version = "2.1.3"
|
7
6
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
7
|
s.authors = ["Norman Clarke", "Adrian Mugnolo", "Emilio Tagua"]
|
9
|
-
s.date = %q{2009-
|
8
|
+
s.date = %q{2009-06-03}
|
10
9
|
s.description = %q{A comprehensive slugging and pretty-URL plugin for ActiveRecord.}
|
11
10
|
s.email = ["norman@rubysouth.com", "adrian@rubysouth.com", "miloops@gmail.com"]
|
12
11
|
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.rdoc"]
|
13
|
-
s.files = ["History.txt", "MIT-LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "config/website.yml", "friendly_id.gemspec", "generators/friendly_id/friendly_id_generator.rb", "generators/friendly_id/templates/create_slugs.rb", "generators/friendly_id_20_upgrade/friendly_id_20_upgrade_generator.rb", "generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb", "init.rb", "lib/friendly_id.rb", "lib/friendly_id/helpers.rb", "lib/friendly_id/non_sluggable_class_methods.rb", "lib/friendly_id/non_sluggable_instance_methods.rb", "lib/friendly_id/slug.rb", "lib/friendly_id/sluggable_class_methods.rb", "lib/friendly_id/sluggable_instance_methods.rb", "lib/friendly_id/version.rb", "lib/tasks/friendly_id.rake", "lib/tasks/friendly_id.rb", "test/contest.rb", "test/custom_slug_normalizer_test.rb", "test/models/book.rb", "test/models/country.rb", "test/models/novel.rb", "test/models/person.rb", "test/models/post.rb", "test/models/thing.rb", "test/models/user.rb", "test/non_slugged_test.rb", "test/schema.rb", "test/scoped_model_test.rb", "test/slug_test.rb", "test/slugged_model_test.rb", "test/sti_test.rb", "test/test_helper.rb"]
|
12
|
+
s.files = ["History.txt", "MIT-LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "config/website.yml", "friendly_id.gemspec", "generators/friendly_id/friendly_id_generator.rb", "generators/friendly_id/templates/create_slugs.rb", "generators/friendly_id_20_upgrade/friendly_id_20_upgrade_generator.rb", "generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb", "init.rb", "lib/friendly_id.rb", "lib/friendly_id/helpers.rb", "lib/friendly_id/non_sluggable_class_methods.rb", "lib/friendly_id/non_sluggable_instance_methods.rb", "lib/friendly_id/slug.rb", "lib/friendly_id/sluggable_class_methods.rb", "lib/friendly_id/sluggable_instance_methods.rb", "lib/friendly_id/version.rb", "lib/tasks/friendly_id.rake", "lib/tasks/friendly_id.rb", "test/contest.rb", "test/custom_slug_normalizer_test.rb", "test/models/book.rb", "test/models/country.rb", "test/models/event.rb", "test/models/novel.rb", "test/models/person.rb", "test/models/post.rb", "test/models/thing.rb", "test/models/user.rb", "test/non_slugged_test.rb", "test/schema.rb", "test/scoped_model_test.rb", "test/slug_test.rb", "test/slugged_model_test.rb", "test/sti_test.rb", "test/test_helper.rb"]
|
14
13
|
s.homepage = %q{http://friendly-id.rubyforge.org/}
|
15
14
|
s.rdoc_options = ["--main", "README.rdoc"]
|
16
15
|
s.require_paths = ["lib"]
|
data/lib/friendly_id/slug.rb
CHANGED
@@ -34,7 +34,7 @@ class Slug < ActiveRecord::Base
|
|
34
34
|
# better urls in your application.
|
35
35
|
def normalize(slug_text)
|
36
36
|
return "" if slug_text.nil? || slug_text == ""
|
37
|
-
ActiveSupport::Multibyte.proxy_class.new(slug_text).normalize(:kc).
|
37
|
+
ActiveSupport::Multibyte.proxy_class.new(slug_text.to_s).normalize(:kc).
|
38
38
|
# For some reason Spanish ¡ and ¿ are not detected as non-word
|
39
39
|
# characters. Bug in Ruby?
|
40
40
|
gsub(/[\W|¡|¿]/u, ' ').
|
data/lib/friendly_id/version.rb
CHANGED
data/test/schema.rb
CHANGED
@@ -32,6 +32,11 @@ ActiveRecord::Schema.define(:version => 1) do
|
|
32
32
|
t.column "name", "string"
|
33
33
|
end
|
34
34
|
|
35
|
+
create_table "events", :force => true do |t|
|
36
|
+
t.column "name", "string"
|
37
|
+
t.column "event_date", "datetime"
|
38
|
+
end
|
39
|
+
|
35
40
|
create_table "slugs", :force => true do |t|
|
36
41
|
t.column "name", "string"
|
37
42
|
t.column "sluggable_id", "integer"
|
data/test/slugged_model_test.rb
CHANGED
@@ -86,6 +86,10 @@ class SluggedModelTest < Test::Unit::TestCase
|
|
86
86
|
assert_match(/--2\z/, @post2.friendly_id)
|
87
87
|
end
|
88
88
|
|
89
|
+
should "allow datetime columns to be used as slugs" do
|
90
|
+
assert Event.create(:name => "Test", :event_date => DateTime.now)
|
91
|
+
end
|
92
|
+
|
89
93
|
should "not strip diacritics" do
|
90
94
|
@post = Post.new(:title => "¡Feliz año!")
|
91
95
|
assert_match(/#{'ñ'}/, @post.slug_text)
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: friendly_id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Norman Clarke
|
@@ -32,7 +32,7 @@ cert_chain:
|
|
32
32
|
h7fbBRfStxI=
|
33
33
|
-----END CERTIFICATE-----
|
34
34
|
|
35
|
-
date: 2009-
|
35
|
+
date: 2009-06-03 00:00:00 -03:00
|
36
36
|
default_executable:
|
37
37
|
dependencies:
|
38
38
|
- !ruby/object:Gem::Dependency
|
@@ -125,6 +125,7 @@ files:
|
|
125
125
|
- test/custom_slug_normalizer_test.rb
|
126
126
|
- test/models/book.rb
|
127
127
|
- test/models/country.rb
|
128
|
+
- test/models/event.rb
|
128
129
|
- test/models/novel.rb
|
129
130
|
- test/models/person.rb
|
130
131
|
- test/models/post.rb
|
metadata.gz.sig
CHANGED
Binary file
|