friendly_id 4.0.0 → 4.0.1
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/.gitignore +1 -0
- data/.travis.yml +5 -5
- data/Changelog.md +11 -365
- data/Guide.rdoc +7 -6
- data/README.md +17 -11
- data/Rakefile +2 -2
- data/friendly_id.gemspec +11 -12
- data/gemfiles/Gemfile.rails-3.0.rb +15 -14
- data/gemfiles/Gemfile.rails-3.1.rb +16 -16
- data/gemfiles/Gemfile.rails-3.2.rb +16 -16
- data/lib/friendly_id.rb +2 -1
- data/lib/friendly_id/base.rb +1 -1
- data/lib/friendly_id/globalize.rb +102 -0
- data/lib/friendly_id/history.rb +24 -4
- data/lib/friendly_id/scoped.rb +13 -9
- data/lib/friendly_id/simple_i18n.rb +1 -1
- data/lib/friendly_id/slug_generator.rb +14 -6
- data/test/base_test.rb +4 -0
- data/test/configuration_test.rb +3 -1
- data/test/core_test.rb +3 -1
- data/test/generator_test.rb +0 -1
- data/test/helper.rb +0 -9
- data/test/history_test.rb +48 -3
- data/test/i18n_test.rb +1 -0
- data/test/object_utils_test.rb +4 -2
- data/test/schema.rb +3 -2
- data/test/scoped_test.rb +35 -9
- data/test/slugged_test.rb +7 -4
- data/test/sti_test.rb +11 -2
- metadata +43 -53
data/lib/friendly_id/scoped.rb
CHANGED
@@ -105,7 +105,7 @@ an example of one way to set this up:
|
|
105
105
|
# @return Symbol The scope value
|
106
106
|
attr_accessor :scope
|
107
107
|
|
108
|
-
# Gets the scope
|
108
|
+
# Gets the scope columns.
|
109
109
|
#
|
110
110
|
# Checks to see if the +:scope+ option passed to
|
111
111
|
# {FriendlyId::Base#friendly_id} refers to a relation, and if so, returns
|
@@ -113,19 +113,19 @@ an example of one way to set this up:
|
|
113
113
|
# the name of column and returns it cast to a String.
|
114
114
|
#
|
115
115
|
# @return String The scope column
|
116
|
-
def
|
117
|
-
(reflection_foreign_key or
|
116
|
+
def scope_columns
|
117
|
+
[@scope].flatten.map { |s| (reflection_foreign_key(s) or s).to_s }
|
118
118
|
end
|
119
119
|
|
120
120
|
private
|
121
121
|
|
122
122
|
if ActiveRecord::VERSION::STRING < "3.1"
|
123
|
-
def reflection_foreign_key
|
124
|
-
model_class.reflections[
|
123
|
+
def reflection_foreign_key(scope)
|
124
|
+
model_class.reflections[scope].try(:primary_key_name)
|
125
125
|
end
|
126
126
|
else
|
127
|
-
def reflection_foreign_key
|
128
|
-
model_class.reflections[
|
127
|
+
def reflection_foreign_key(scope)
|
128
|
+
model_class.reflections[scope].try(:foreign_key)
|
129
129
|
end
|
130
130
|
end
|
131
131
|
end
|
@@ -137,8 +137,12 @@ an example of one way to set this up:
|
|
137
137
|
private
|
138
138
|
|
139
139
|
def conflict
|
140
|
-
|
141
|
-
|
140
|
+
columns = friendly_id_config.scope_columns
|
141
|
+
matched = columns.inject(conflicts) do |memo, column|
|
142
|
+
memo.where(column => sluggable.send(column))
|
143
|
+
end
|
144
|
+
|
145
|
+
matched.first
|
142
146
|
end
|
143
147
|
end
|
144
148
|
end
|
@@ -12,10 +12,7 @@ module FriendlyId
|
|
12
12
|
|
13
13
|
# Given a slug, get the next available slug in the sequence.
|
14
14
|
def next
|
15
|
-
#
|
16
|
-
sequence = conflict.to_param.gsub(/^#{Regexp.quote(normalized)}(#{Regexp.quote(separator)})?/, '').to_i
|
17
|
-
next_sequence = sequence == 0 ? 2 : sequence.next
|
18
|
-
"#{normalized}#{separator}#{next_sequence}"
|
15
|
+
"#{normalized}#{separator}#{next_in_sequence}"
|
19
16
|
end
|
20
17
|
|
21
18
|
# Generate a new sequenced slug.
|
@@ -25,6 +22,15 @@ module FriendlyId
|
|
25
22
|
|
26
23
|
private
|
27
24
|
|
25
|
+
def next_in_sequence
|
26
|
+
last_in_sequence == 0 ? 2 : last_in_sequence.next
|
27
|
+
end
|
28
|
+
|
29
|
+
def last_in_sequence
|
30
|
+
# Don't assume that the separator is unique in the slug.
|
31
|
+
@_last_in_sequence ||= conflict.to_param.gsub(/^#{Regexp.quote(normalized)}(#{Regexp.quote(separator)})?/, '').to_i
|
32
|
+
end
|
33
|
+
|
28
34
|
def column
|
29
35
|
sluggable.connection.quote_column_name friendly_id_config.slug_column
|
30
36
|
end
|
@@ -41,9 +47,11 @@ module FriendlyId
|
|
41
47
|
end
|
42
48
|
|
43
49
|
def conflicts
|
44
|
-
|
50
|
+
sluggable_class = friendly_id_config.model_class
|
51
|
+
|
52
|
+
pkey = sluggable_class.primary_key
|
45
53
|
value = sluggable.send pkey
|
46
|
-
scope =
|
54
|
+
scope = sluggable_class.unscoped.where("#{column} = ? OR #{column} LIKE ?", normalized, wildcard)
|
47
55
|
scope = scope.where("#{pkey} <> ?", value) unless sluggable.new_record?
|
48
56
|
scope = scope.order("LENGTH(#{column}) DESC, #{column} DESC")
|
49
57
|
end
|
data/test/base_test.rb
CHANGED
@@ -5,6 +5,7 @@ class CoreTest < MiniTest::Unit::TestCase
|
|
5
5
|
|
6
6
|
test "friendly_id should accept a base and a hash" do
|
7
7
|
klass = Class.new(ActiveRecord::Base) do
|
8
|
+
self.abstract_class = true
|
8
9
|
extend FriendlyId
|
9
10
|
friendly_id :foo, :use => :slugged, :slug_column => :bar
|
10
11
|
end
|
@@ -16,6 +17,7 @@ class CoreTest < MiniTest::Unit::TestCase
|
|
16
17
|
|
17
18
|
test "friendly_id should accept a block" do
|
18
19
|
klass = Class.new(ActiveRecord::Base) do
|
20
|
+
self.abstract_class = true
|
19
21
|
extend FriendlyId
|
20
22
|
friendly_id :foo do |config|
|
21
23
|
config.use :slugged
|
@@ -30,6 +32,7 @@ class CoreTest < MiniTest::Unit::TestCase
|
|
30
32
|
|
31
33
|
test "the block passed to friendly_id should be evaluated before arguments" do
|
32
34
|
klass = Class.new(ActiveRecord::Base) do
|
35
|
+
self.abstract_class = true
|
33
36
|
extend FriendlyId
|
34
37
|
friendly_id :foo do |config|
|
35
38
|
config.base = :bar
|
@@ -44,6 +47,7 @@ class CoreTest < MiniTest::Unit::TestCase
|
|
44
47
|
config.base = :foo
|
45
48
|
end
|
46
49
|
klass = Class.new(ActiveRecord::Base) do
|
50
|
+
self.abstract_class = true
|
47
51
|
extend FriendlyId
|
48
52
|
end
|
49
53
|
assert_equal :foo, klass.friendly_id_config.base
|
data/test/configuration_test.rb
CHANGED
@@ -5,7 +5,9 @@ class ConfigurationTest < MiniTest::Unit::TestCase
|
|
5
5
|
include FriendlyId::Test
|
6
6
|
|
7
7
|
def setup
|
8
|
-
@model_class = Class.new(ActiveRecord::Base)
|
8
|
+
@model_class = Class.new(ActiveRecord::Base) do
|
9
|
+
self.abstract_class = true
|
10
|
+
end
|
9
11
|
end
|
10
12
|
|
11
13
|
test "should set model class on initialization" do
|
data/test/core_test.rb
CHANGED
@@ -20,7 +20,9 @@ class CoreTest < MiniTest::Unit::TestCase
|
|
20
20
|
end
|
21
21
|
|
22
22
|
test "models don't use friendly_id by default" do
|
23
|
-
assert !Class.new(ActiveRecord::Base)
|
23
|
+
assert !Class.new(ActiveRecord::Base) {
|
24
|
+
self.abstract_class = true
|
25
|
+
}.respond_to?(:friendly_id)
|
24
26
|
end
|
25
27
|
|
26
28
|
test "model classes should have a friendly id config" do
|
data/test/generator_test.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -51,15 +51,6 @@ module FriendlyId
|
|
51
51
|
driver = FriendlyId::Test::Database.driver
|
52
52
|
engine = RUBY_ENGINE rescue "ruby"
|
53
53
|
|
54
|
-
# This hack is needed to get AR 3.1 + JDBC to play nicely together
|
55
|
-
if version >= "3.1" && engine == "jruby"
|
56
|
-
if driver == "sqlite3"
|
57
|
-
puts "Skipping SQLite3 test on JRuby with AR 3.1; it doesn't currently work."
|
58
|
-
exit 0
|
59
|
-
end
|
60
|
-
config.each { |_, value| value["adapter"] = "jdbc" + value["adapter"].gsub(/2\z/, '') }
|
61
|
-
end
|
62
|
-
|
63
54
|
ActiveRecord::Base.establish_connection config[driver]
|
64
55
|
message = "Using #{engine} #{RUBY_VERSION} AR #{version} with #{driver}"
|
65
56
|
|
data/test/history_test.rb
CHANGED
@@ -15,7 +15,7 @@ class HistoryTest < MiniTest::Unit::TestCase
|
|
15
15
|
end
|
16
16
|
|
17
17
|
test "should insert record in slugs table on create" do
|
18
|
-
with_instance_of(model_class) {|record| assert
|
18
|
+
with_instance_of(model_class) {|record| assert record.slugs.any?}
|
19
19
|
end
|
20
20
|
|
21
21
|
test "should not create new slug record if friendly_id is not changed" do
|
@@ -48,6 +48,17 @@ class HistoryTest < MiniTest::Unit::TestCase
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
+
test "should create slug records on each change" do
|
52
|
+
transaction do
|
53
|
+
record = model_class.create! :name => "hello"
|
54
|
+
assert_equal 1, FriendlyId::Slug.count
|
55
|
+
record = model_class.find("hello")
|
56
|
+
record.name = "hello again"
|
57
|
+
record.save!
|
58
|
+
assert_equal 2, FriendlyId::Slug.count
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
51
62
|
test "should not be read only when found by old slug" do
|
52
63
|
with_instance_of(model_class) do |record|
|
53
64
|
old_friendly_id = record.friendly_id
|
@@ -59,8 +70,10 @@ class HistoryTest < MiniTest::Unit::TestCase
|
|
59
70
|
|
60
71
|
|
61
72
|
test "should raise error if used with scoped" do
|
62
|
-
model_class = Class.new(ActiveRecord::Base)
|
63
|
-
|
73
|
+
model_class = Class.new(ActiveRecord::Base) do
|
74
|
+
self.abstract_class = true
|
75
|
+
extend FriendlyId
|
76
|
+
end
|
64
77
|
assert_raises RuntimeError do
|
65
78
|
model_class.friendly_id :name, :use => [:history, :scoped]
|
66
79
|
end
|
@@ -77,4 +90,36 @@ class HistoryTest < MiniTest::Unit::TestCase
|
|
77
90
|
end
|
78
91
|
end
|
79
92
|
|
93
|
+
test "should not create new slugs that match old slugs" do
|
94
|
+
transaction do
|
95
|
+
first_record = model_class.create! :name => "foo"
|
96
|
+
first_record.name = "bar"
|
97
|
+
first_record.save!
|
98
|
+
second_record = model_class.create! :name => "foo"
|
99
|
+
assert second_record.slug != "foo"
|
100
|
+
assert second_record.slug == "foo--2"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
test 'should increment the sequence by one for each historic slug' do
|
105
|
+
transaction do
|
106
|
+
previous_record = model_class.create! :name => "foo"
|
107
|
+
first_record = model_class.create! :name => 'another'
|
108
|
+
second_record = model_class.create! :name => 'another'
|
109
|
+
assert second_record.slug == "another--2"
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
test 'should not fail when updating historic slugs' do
|
114
|
+
transaction do
|
115
|
+
first_record = model_class.create! :name => "foo"
|
116
|
+
second_record = model_class.create! :name => 'another'
|
117
|
+
|
118
|
+
second_record.update_attributes :name => 'foo'
|
119
|
+
assert second_record.slug == "foo--2"
|
120
|
+
first_record.update_attributes :name => 'another'
|
121
|
+
assert first_record.slug == "another--2"
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
80
125
|
end
|
data/test/i18n_test.rb
CHANGED
@@ -100,6 +100,7 @@ class I18nTest < MiniTest::Unit::TestCase
|
|
100
100
|
|
101
101
|
test "should add locale to non-default slug column and non-default locale" do
|
102
102
|
model_class = Class.new(ActiveRecord::Base) do
|
103
|
+
self.abstract_class = true
|
103
104
|
extend FriendlyId
|
104
105
|
friendly_id :name, :use => :simple_i18n, :slug_column => :foo
|
105
106
|
end
|
data/test/object_utils_test.rb
CHANGED
@@ -19,8 +19,10 @@ class ObjectUtilsTest < MiniTest::Unit::TestCase
|
|
19
19
|
end
|
20
20
|
|
21
21
|
test "ActiveRecord::Base instances should be unfriendly_ids" do
|
22
|
-
model_class = Class.new(ActiveRecord::Base)
|
23
|
-
|
22
|
+
model_class = Class.new(ActiveRecord::Base) do
|
23
|
+
self.abstract_class = true
|
24
|
+
self.table_name = "authors"
|
25
|
+
end
|
24
26
|
assert model_class.new.unfriendly_id?
|
25
27
|
end
|
26
28
|
end
|
data/test/schema.rb
CHANGED
@@ -30,6 +30,7 @@ module FriendlyId
|
|
30
30
|
|
31
31
|
# This will be used to test scopes
|
32
32
|
add_column :novels, :novelist_id, :integer
|
33
|
+
add_column :novels, :publisher_id, :integer
|
33
34
|
remove_index :novels, :slug
|
34
35
|
|
35
36
|
# This will be used to test column name quoting
|
@@ -53,7 +54,7 @@ module FriendlyId
|
|
53
54
|
end
|
54
55
|
|
55
56
|
def simple_tables
|
56
|
-
["authors", "books"]
|
57
|
+
["authors", "books", "publishers"]
|
57
58
|
end
|
58
59
|
|
59
60
|
def tables
|
@@ -62,4 +63,4 @@ module FriendlyId
|
|
62
63
|
end
|
63
64
|
end
|
64
65
|
end
|
65
|
-
end
|
66
|
+
end
|
data/test/scoped_test.rb
CHANGED
@@ -8,7 +8,12 @@ end
|
|
8
8
|
class Novel < ActiveRecord::Base
|
9
9
|
extend FriendlyId
|
10
10
|
belongs_to :novelist
|
11
|
-
|
11
|
+
belongs_to :publisher
|
12
|
+
friendly_id :name, :use => :scoped, :scope => [:publisher, :novelist]
|
13
|
+
end
|
14
|
+
|
15
|
+
class Publisher < ActiveRecord::Base
|
16
|
+
has_many :novels
|
12
17
|
end
|
13
18
|
|
14
19
|
class ScopedTest < MiniTest::Unit::TestCase
|
@@ -21,14 +26,16 @@ class ScopedTest < MiniTest::Unit::TestCase
|
|
21
26
|
end
|
22
27
|
|
23
28
|
test "should detect scope column from belongs_to relation" do
|
24
|
-
assert_equal "novelist_id", Novel.friendly_id_config.
|
29
|
+
assert_equal ["publisher_id", "novelist_id"], Novel.friendly_id_config.scope_columns
|
25
30
|
end
|
26
31
|
|
27
32
|
test "should detect scope column from explicit column name" do
|
28
|
-
model_class = Class.new(ActiveRecord::Base)
|
29
|
-
|
30
|
-
|
31
|
-
|
33
|
+
model_class = Class.new(ActiveRecord::Base) do
|
34
|
+
self.abstract_class = true
|
35
|
+
extend FriendlyId
|
36
|
+
friendly_id :empty, :use => :scoped, :scope => :dummy
|
37
|
+
end
|
38
|
+
assert_equal ["dummy"], model_class.friendly_id_config.scope_columns
|
32
39
|
end
|
33
40
|
|
34
41
|
test "should allow duplicate slugs outside scope" do
|
@@ -48,10 +55,29 @@ class ScopedTest < MiniTest::Unit::TestCase
|
|
48
55
|
end
|
49
56
|
|
50
57
|
test "should raise error if used with history" do
|
51
|
-
model_class = Class.new(ActiveRecord::Base)
|
52
|
-
|
58
|
+
model_class = Class.new(ActiveRecord::Base) do
|
59
|
+
self.abstract_class = true
|
60
|
+
extend FriendlyId
|
61
|
+
end
|
62
|
+
|
53
63
|
assert_raises RuntimeError do
|
54
64
|
model_class.friendly_id :name, :use => [:scoped, :history]
|
55
65
|
end
|
56
66
|
end
|
57
|
-
|
67
|
+
|
68
|
+
test "should apply scope with multiple columns" do
|
69
|
+
transaction do
|
70
|
+
novelist = Novelist.create! :name => "a"
|
71
|
+
publisher = Publisher.create! :name => "b"
|
72
|
+
|
73
|
+
novel1 = Novel.create! :name => "c", :novelist => novelist, :publisher => publisher
|
74
|
+
novel2 = Novel.create! :name => "c", :novelist => novelist, :publisher => Publisher.create(:name => "d")
|
75
|
+
novel3 = Novel.create! :name => "c", :novelist => Novelist.create(:name => "e"), :publisher => publisher
|
76
|
+
novel4 = Novel.create! :name => "c", :novelist => novelist, :publisher => publisher
|
77
|
+
|
78
|
+
assert_equal novel1.friendly_id, novel2.friendly_id
|
79
|
+
assert_equal novel2.friendly_id, novel3.friendly_id
|
80
|
+
assert novel3.friendly_id != novel4.friendly_id
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
data/test/slugged_test.rb
CHANGED
@@ -78,10 +78,13 @@ class SlugGeneratorTest < MiniTest::Unit::TestCase
|
|
78
78
|
end
|
79
79
|
|
80
80
|
test "should quote column names" do
|
81
|
-
model_class
|
82
|
-
|
83
|
-
|
84
|
-
|
81
|
+
model_class = Class.new(ActiveRecord::Base) do
|
82
|
+
self.abstract_class = true
|
83
|
+
self.table_name = "journalists"
|
84
|
+
extend FriendlyId
|
85
|
+
friendly_id :name, :use => :slugged, :slug_column => "strange name"
|
86
|
+
end
|
87
|
+
|
85
88
|
begin
|
86
89
|
with_instance_of(model_class) {|record| assert model_class.find(record.friendly_id)}
|
87
90
|
rescue ActiveRecord::StatementInvalid
|
data/test/sti_test.rb
CHANGED
@@ -20,6 +20,7 @@ class StiTest < MiniTest::Unit::TestCase
|
|
20
20
|
|
21
21
|
test "friendly_id should accept a base and a hash with single table inheritance" do
|
22
22
|
abstract_klass = Class.new(ActiveRecord::Base) do
|
23
|
+
def self.table_exists?; false end
|
23
24
|
extend FriendlyId
|
24
25
|
friendly_id :foo, :use => :slugged, :slug_column => :bar
|
25
26
|
end
|
@@ -29,9 +30,9 @@ class StiTest < MiniTest::Unit::TestCase
|
|
29
30
|
assert_equal :bar, klass.friendly_id_config.slug_column
|
30
31
|
end
|
31
32
|
|
32
|
-
|
33
33
|
test "friendly_id should accept a block with single table inheritance" do
|
34
34
|
abstract_klass = Class.new(ActiveRecord::Base) do
|
35
|
+
def self.table_exists?; false end
|
35
36
|
extend FriendlyId
|
36
37
|
friendly_id :foo do |config|
|
37
38
|
config.use :slugged
|
@@ -45,4 +46,12 @@ class StiTest < MiniTest::Unit::TestCase
|
|
45
46
|
assert_equal :bar, klass.friendly_id_config.slug_column
|
46
47
|
end
|
47
48
|
|
48
|
-
|
49
|
+
test "friendly_id slugs should not clash with eachother" do
|
50
|
+
journalist = Journalist.create! :name => 'foo bar'
|
51
|
+
editoralist = Editorialist.create! :name => 'foo bar'
|
52
|
+
|
53
|
+
assert_equal 'foo-bar', journalist.slug
|
54
|
+
assert_equal 'foo-bar--2', editoralist.slug
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
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: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,110 +9,99 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-02-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
|
-
requirement: &
|
16
|
+
requirement: &70170127893680 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 3.
|
21
|
+
version: 3.2.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70170127893680
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activerecord
|
27
|
-
requirement: &
|
27
|
+
requirement: &70170127892900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 3.
|
32
|
+
version: 3.2.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: sqlite3
|
38
|
-
requirement: &70322990490880 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 1.3.4
|
44
|
-
type: :development
|
45
|
-
prerelease: false
|
46
|
-
version_requirements: *70322990490880
|
35
|
+
version_requirements: *70170127892900
|
47
36
|
- !ruby/object:Gem::Dependency
|
48
37
|
name: minitest
|
49
|
-
requirement: &
|
38
|
+
requirement: &70170127892400 !ruby/object:Gem::Requirement
|
50
39
|
none: false
|
51
40
|
requirements:
|
52
|
-
- -
|
41
|
+
- - ! '>='
|
53
42
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
43
|
+
version: '0'
|
55
44
|
type: :development
|
56
45
|
prerelease: false
|
57
|
-
version_requirements: *
|
46
|
+
version_requirements: *70170127892400
|
58
47
|
- !ruby/object:Gem::Dependency
|
59
48
|
name: mocha
|
60
|
-
requirement: &
|
49
|
+
requirement: &70170127891740 !ruby/object:Gem::Requirement
|
61
50
|
none: false
|
62
51
|
requirements:
|
63
|
-
- -
|
52
|
+
- - ! '>='
|
64
53
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0
|
54
|
+
version: '0'
|
66
55
|
type: :development
|
67
56
|
prerelease: false
|
68
|
-
version_requirements: *
|
57
|
+
version_requirements: *70170127891740
|
69
58
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
71
|
-
requirement: &
|
59
|
+
name: maruku
|
60
|
+
requirement: &70170127891160 !ruby/object:Gem::Requirement
|
72
61
|
none: false
|
73
62
|
requirements:
|
74
|
-
- -
|
63
|
+
- - ! '>='
|
75
64
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
65
|
+
version: '0'
|
77
66
|
type: :development
|
78
67
|
prerelease: false
|
79
|
-
version_requirements: *
|
68
|
+
version_requirements: *70170127891160
|
80
69
|
- !ruby/object:Gem::Dependency
|
81
|
-
name:
|
82
|
-
requirement: &
|
70
|
+
name: yard
|
71
|
+
requirement: &70170127890460 !ruby/object:Gem::Requirement
|
83
72
|
none: false
|
84
73
|
requirements:
|
85
|
-
- -
|
74
|
+
- - ! '>='
|
86
75
|
- !ruby/object:Gem::Version
|
87
|
-
version: 0
|
76
|
+
version: '0'
|
88
77
|
type: :development
|
89
78
|
prerelease: false
|
90
|
-
version_requirements: *
|
79
|
+
version_requirements: *70170127890460
|
91
80
|
- !ruby/object:Gem::Dependency
|
92
|
-
name:
|
93
|
-
requirement: &
|
81
|
+
name: i18n
|
82
|
+
requirement: &70170127889980 !ruby/object:Gem::Requirement
|
94
83
|
none: false
|
95
84
|
requirements:
|
96
|
-
- -
|
85
|
+
- - ! '>='
|
97
86
|
- !ruby/object:Gem::Version
|
98
|
-
version: 0
|
87
|
+
version: '0'
|
99
88
|
type: :development
|
100
89
|
prerelease: false
|
101
|
-
version_requirements: *
|
90
|
+
version_requirements: *70170127889980
|
102
91
|
- !ruby/object:Gem::Dependency
|
103
|
-
name:
|
104
|
-
requirement: &
|
92
|
+
name: ffaker
|
93
|
+
requirement: &70170127889500 !ruby/object:Gem::Requirement
|
105
94
|
none: false
|
106
95
|
requirements:
|
107
|
-
- -
|
96
|
+
- - ! '>='
|
108
97
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0
|
98
|
+
version: '0'
|
110
99
|
type: :development
|
111
100
|
prerelease: false
|
112
|
-
version_requirements: *
|
101
|
+
version_requirements: *70170127889500
|
113
102
|
- !ruby/object:Gem::Dependency
|
114
103
|
name: simplecov
|
115
|
-
requirement: &
|
104
|
+
requirement: &70170127888840 !ruby/object:Gem::Requirement
|
116
105
|
none: false
|
117
106
|
requirements:
|
118
107
|
- - ! '>='
|
@@ -120,13 +109,13 @@ dependencies:
|
|
120
109
|
version: '0'
|
121
110
|
type: :development
|
122
111
|
prerelease: false
|
123
|
-
version_requirements: *
|
112
|
+
version_requirements: *70170127888840
|
124
113
|
description: ! 'FriendlyId is the "Swiss Army bulldozer" of slugging and permalink
|
125
114
|
plugins for
|
126
115
|
|
127
|
-
Ruby on Rails. It allows you to create pretty
|
116
|
+
Ruby on Rails. It allows you to create pretty URLs and work with human-friendly
|
128
117
|
|
129
|
-
|
118
|
+
strings as if they were numeric ids for Active Record models.
|
130
119
|
|
131
120
|
'
|
132
121
|
email:
|
@@ -155,6 +144,7 @@ files:
|
|
155
144
|
- lib/friendly_id/base.rb
|
156
145
|
- lib/friendly_id/configuration.rb
|
157
146
|
- lib/friendly_id/finder_methods.rb
|
147
|
+
- lib/friendly_id/globalize.rb
|
158
148
|
- lib/friendly_id/history.rb
|
159
149
|
- lib/friendly_id/migration.rb
|
160
150
|
- lib/friendly_id/object_utils.rb
|
@@ -185,7 +175,7 @@ files:
|
|
185
175
|
- test/shared.rb
|
186
176
|
- test/slugged_test.rb
|
187
177
|
- test/sti_test.rb
|
188
|
-
homepage: http://
|
178
|
+
homepage: http://github.com/norman/friendly_id
|
189
179
|
licenses: []
|
190
180
|
post_install_message: ! 'NOTE: FriendlyId 4.x breaks compatibility with 3.x. If you''re
|
191
181
|
upgrading
|
@@ -214,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
204
|
version: '0'
|
215
205
|
requirements: []
|
216
206
|
rubyforge_project: friendly_id
|
217
|
-
rubygems_version: 1.8.
|
207
|
+
rubygems_version: 1.8.11
|
218
208
|
signing_key:
|
219
209
|
specification_version: 3
|
220
210
|
summary: A comprehensive slugging and pretty-URL plugin.
|