sluggable_finder 2.3.4 → 2.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sluggable_finder (2.3.4)
4
+ sluggable_finder (2.3.5)
5
5
  activerecord (<= 2.8.0)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- activerecord (2.3.11)
11
- activesupport (= 2.3.11)
12
- activesupport (2.3.11)
10
+ activerecord (2.3.18)
11
+ activesupport (= 2.3.18)
12
+ activesupport (2.3.18)
13
13
  diff-lcs (1.1.2)
14
14
  rake (0.8.7)
15
15
  rspec (2.6.0)
@@ -22,6 +22,7 @@ module SluggableFinder
22
22
  :allow_integer_ids => true,
23
23
  :upcase => false,
24
24
  :slug_modifier => slug_modifier || nil,
25
+ :separator => '-',
25
26
  :ignore_sti => false # if true, Uniqueness won't check sibling classes.
26
27
  }.merge( options ))
27
28
  class_inheritable_reader :sluggable_finder_options
@@ -108,7 +109,7 @@ module SluggableFinder
108
109
  existing = slugable_class.find(:first, :conditions => [conds_sql, proposed_slug + suffix])
109
110
  while existing != nil or sluggable_finder_options[:reserved_slugs].include?(proposed_slug + suffix)
110
111
  if suffix.empty?
111
- suffix = "-2"
112
+ suffix = "#{sluggable_finder_options[:separator]}2"
112
113
  else
113
114
  suffix.succ!
114
115
  end
@@ -1,3 +1,3 @@
1
1
  module SluggableFinder
2
- VERSION = '2.3.4'
3
- end
2
+ VERSION = '2.3.5'
3
+ end
@@ -83,6 +83,10 @@ class ScopedItem < Item
83
83
  sluggable_finder :title, :scope => :category_id
84
84
  end
85
85
 
86
+ class DifferentSeparatorItem < Item
87
+ sluggable_finder :title, :separator => ':'
88
+ end
89
+
86
90
  describe "random slugs" do
87
91
  it "should generate random slugs" do
88
92
  SluggableFinder.random_slug_for(String).should_not be_nil
@@ -148,6 +152,17 @@ describe "SluggableFinder" do
148
152
  end
149
153
  end
150
154
 
155
+ describe 'with custom suffix separator' do
156
+ before(:each) do
157
+ DifferentSeparatorItem.create!(:title => 'A title')
158
+ @i2 = DifferentSeparatorItem.create!(:title => 'A title')
159
+ end
160
+
161
+ it 'creates unique slug with custom suffix separator' do
162
+ @i2.slug.should == 'a-title:2'
163
+ end
164
+ end
165
+
151
166
  describe 'with modifier block' do
152
167
 
153
168
  it 'should pass slug through block before saving' do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sluggable_finder
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
- - 4
10
- version: 2.3.4
9
+ - 5
10
+ version: 2.3.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ismael Celis
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2014-07-11 00:00:00 +01:00
19
- default_executable:
18
+ date: 2014-10-02 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -30,10 +29,10 @@ dependencies:
30
29
  - 0
31
30
  - 0
32
31
  version: 1.0.0
33
- requirement: *id001
34
32
  prerelease: false
35
- name: bundler
33
+ requirement: *id001
36
34
  type: :development
35
+ name: bundler
37
36
  - !ruby/object:Gem::Dependency
38
37
  version_requirements: &id002 !ruby/object:Gem::Requirement
39
38
  none: false
@@ -44,10 +43,10 @@ dependencies:
44
43
  segments:
45
44
  - 0
46
45
  version: "0"
47
- requirement: *id002
48
46
  prerelease: false
49
- name: rspec
47
+ requirement: *id002
50
48
  type: :development
49
+ name: rspec
51
50
  - !ruby/object:Gem::Dependency
52
51
  version_requirements: &id003 !ruby/object:Gem::Requirement
53
52
  none: false
@@ -58,10 +57,10 @@ dependencies:
58
57
  segments:
59
58
  - 0
60
59
  version: "0"
61
- requirement: *id003
62
60
  prerelease: false
63
- name: rake
61
+ requirement: *id003
64
62
  type: :development
63
+ name: rake
65
64
  - !ruby/object:Gem::Dependency
66
65
  version_requirements: &id004 !ruby/object:Gem::Requirement
67
66
  none: false
@@ -72,10 +71,10 @@ dependencies:
72
71
  segments:
73
72
  - 0
74
73
  version: "0"
75
- requirement: *id004
76
74
  prerelease: false
77
- name: sqlite3
75
+ requirement: *id004
78
76
  type: :development
77
+ name: sqlite3
79
78
  - !ruby/object:Gem::Dependency
80
79
  version_requirements: &id005 !ruby/object:Gem::Requirement
81
80
  none: false
@@ -88,10 +87,10 @@ dependencies:
88
87
  - 8
89
88
  - 0
90
89
  version: 2.8.0
91
- requirement: *id005
92
90
  prerelease: false
93
- name: activerecord
91
+ requirement: *id005
94
92
  type: :runtime
93
+ name: activerecord
95
94
  description: This plugin allows models to generate a unique "slug" (url-enabled name) from any regular attribute. Add friendly URLs to your models with one line.
96
95
  email:
97
96
  - ismaelct@gmail.com
@@ -125,7 +124,6 @@ files:
125
124
  - spec/spec_helper.rb
126
125
  - tasks/db.rake
127
126
  - tasks/rspec.rake
128
- has_rdoc: true
129
127
  homepage: https://github.com/ismasan/sluggable-finder
130
128
  licenses: []
131
129
 
@@ -157,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
155
  requirements: []
158
156
 
159
157
  rubyforge_project: sluggable_finder
160
- rubygems_version: 1.5.3
158
+ rubygems_version: 1.8.29
161
159
  signing_key:
162
160
  specification_version: 3
163
161
  summary: Easy friendly URLs for your ActiveRecord models