vidibus-permalink 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,26 +1,17 @@
1
- $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
1
+ $:.unshift File.expand_path('../lib/', __FILE__)
2
2
 
3
- require "bundler"
4
- require "rdoc/task"
5
- require "rspec"
6
- require "rspec/core/rake_task"
7
-
8
- require "vidibus/permalink/version"
3
+ require 'bundler'
4
+ require 'rdoc/task'
5
+ require 'rspec'
6
+ require 'rspec/core/rake_task'
7
+ require 'vidibus/permalink/version'
9
8
 
10
9
  Bundler::GemHelper.install_tasks
11
10
 
12
- RSpec::Core::RakeTask.new(:rcov) do |t|
13
- t.pattern = "spec/**/*_spec.rb"
14
- t.rcov = true
15
- t.rcov_opts = ["--exclude", "^spec,/gems/"]
16
- end
17
-
18
11
  Rake::RDocTask.new do |rdoc|
19
- rdoc.rdoc_dir = "rdoc"
12
+ rdoc.rdoc_dir = 'rdoc'
20
13
  rdoc.title = "vidibus-permalink #{Vidibus::Permalink::VERSION}"
21
- rdoc.rdoc_files.include("README*")
22
- rdoc.rdoc_files.include("lib/**/*.rb")
23
- rdoc.options << "--charset=utf-8"
14
+ rdoc.rdoc_files.include('README*')
15
+ rdoc.rdoc_files.include('lib/**/*.rb')
16
+ rdoc.options << '--charset=utf-8'
24
17
  end
25
-
26
- task :default => :rcov
@@ -7,7 +7,8 @@ module Vidibus
7
7
 
8
8
  included do
9
9
  field :permalink, :type => String
10
- index :permalink
10
+ field :static_permalink, :type => String
11
+ index :permalink, :static_permalink
11
12
 
12
13
  attr_accessor :skip_permalink
13
14
 
@@ -110,6 +111,12 @@ module Vidibus
110
111
  else
111
112
  self.permalink = ::Permalink.sanitize(value)
112
113
  end
114
+
115
+ if new_record?
116
+ self.static_permalink = self.permalink
117
+ else
118
+ self.static_permalink ||= self.permalink
119
+ end
113
120
  end
114
121
 
115
122
  # Stores current new permalink object or updates an existing one that matches.
@@ -1,5 +1,5 @@
1
1
  module Vidibus
2
2
  module Permalink
3
- VERSION = "0.1.5"
3
+ VERSION = '0.1.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,189 +1,198 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: vidibus-permalink
3
- version: !ruby/object:Gem::Version
4
- hash: 17
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.6
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 5
10
- version: 0.1.5
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Andre Pankratz
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-09-14 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2012-07-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: activesupport
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
18
+ requirements:
27
19
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 7
30
- segments:
31
- - 3
32
- - 0
33
- version: "3.0"
20
+ - !ruby/object:Gem::Version
21
+ version: '3.1'
34
22
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: mongoid
38
23
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.1'
30
+ - !ruby/object:Gem::Dependency
31
+ name: mongoid
32
+ requirement: !ruby/object:Gem::Requirement
40
33
  none: false
41
- requirements:
34
+ requirements:
42
35
  - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 7
45
- segments:
46
- - 2
47
- version: "2"
36
+ - !ruby/object:Gem::Version
37
+ version: '2'
48
38
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: vidibus-core_extensions
52
39
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
54
- none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 0
61
- version: "0"
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '2'
46
+ - !ruby/object:Gem::Dependency
47
+ name: vidibus-core_extensions
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
62
54
  type: :runtime
63
- version_requirements: *id003
64
- - !ruby/object:Gem::Dependency
65
- name: vidibus-uuid
66
55
  prerelease: false
67
- requirement: &id004 !ruby/object:Gem::Requirement
68
- none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
- version: "0"
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: vidibus-uuid
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
76
70
  type: :runtime
77
- version_requirements: *id004
78
- - !ruby/object:Gem::Dependency
79
- name: vidibus-words
80
71
  prerelease: false
81
- requirement: &id005 !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- hash: 3
87
- segments:
88
- - 0
89
- version: "0"
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: vidibus-words
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
90
86
  type: :runtime
91
- version_requirements: *id005
92
- - !ruby/object:Gem::Dependency
93
- name: bundler
94
87
  prerelease: false
95
- requirement: &id006 !ruby/object:Gem::Requirement
96
- none: false
97
- requirements:
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- hash: 23
101
- segments:
102
- - 1
103
- - 0
104
- - 0
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: bundler
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
105
101
  version: 1.0.0
106
102
  type: :development
107
- version_requirements: *id006
108
- - !ruby/object:Gem::Dependency
109
- name: rspec
110
103
  prerelease: false
111
- requirement: &id007 !ruby/object:Gem::Requirement
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 1.0.0
110
+ - !ruby/object:Gem::Dependency
111
+ name: rspec
112
+ requirement: !ruby/object:Gem::Requirement
112
113
  none: false
113
- requirements:
114
+ requirements:
114
115
  - - ~>
115
- - !ruby/object:Gem::Version
116
- hash: 7
117
- segments:
118
- - 2
119
- version: "2"
116
+ - !ruby/object:Gem::Version
117
+ version: '2'
120
118
  type: :development
121
- version_requirements: *id007
122
- - !ruby/object:Gem::Dependency
123
- name: rr
124
119
  prerelease: false
125
- requirement: &id008 !ruby/object:Gem::Requirement
126
- none: false
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- hash: 3
131
- segments:
132
- - 0
133
- version: "0"
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: '2'
126
+ - !ruby/object:Gem::Dependency
127
+ name: rr
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
134
  type: :development
135
- version_requirements: *id008
136
- - !ruby/object:Gem::Dependency
137
- name: rake
138
135
  prerelease: false
139
- requirement: &id009 !ruby/object:Gem::Requirement
140
- none: false
141
- requirements:
142
- - - ">="
143
- - !ruby/object:Gem::Version
144
- hash: 3
145
- segments:
146
- - 0
147
- version: "0"
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: rake
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
148
150
  type: :development
149
- version_requirements: *id009
150
- - !ruby/object:Gem::Dependency
151
- name: rcov
152
151
  prerelease: false
153
- requirement: &id010 !ruby/object:Gem::Requirement
154
- none: false
155
- requirements:
156
- - - ">="
157
- - !ruby/object:Gem::Version
158
- hash: 3
159
- segments:
160
- - 0
161
- version: "0"
162
- type: :development
163
- version_requirements: *id010
164
- - !ruby/object:Gem::Dependency
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ - !ruby/object:Gem::Dependency
165
159
  name: rdoc
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
166
167
  prerelease: false
167
- requirement: &id011 !ruby/object:Gem::Requirement
168
- none: false
169
- requirements:
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- hash: 3
173
- segments:
174
- - 0
175
- version: "0"
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ - !ruby/object:Gem::Dependency
175
+ name: simplecov
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
176
182
  type: :development
177
- version_requirements: *id011
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
178
190
  description: Allows changeable permalinks (good for SEO).
179
191
  email: andre@vidibus.com
180
192
  executables: []
181
-
182
193
  extensions: []
183
-
184
194
  extra_rdoc_files: []
185
-
186
- files:
195
+ files:
187
196
  - lib/vidibus/permalink/dispatcher.rb
188
197
  - lib/vidibus/permalink/mongoid.rb
189
198
  - lib/vidibus/permalink/version.rb
@@ -193,41 +202,31 @@ files:
193
202
  - LICENSE
194
203
  - README.md
195
204
  - Rakefile
196
- has_rdoc: true
197
205
  homepage: https://github.com/vidibus/vidibus-permalink
198
206
  licenses: []
199
-
200
207
  post_install_message:
201
208
  rdoc_options: []
202
-
203
- require_paths:
209
+ require_paths:
204
210
  - lib
205
- required_ruby_version: !ruby/object:Gem::Requirement
211
+ required_ruby_version: !ruby/object:Gem::Requirement
206
212
  none: false
207
- requirements:
208
- - - ">="
209
- - !ruby/object:Gem::Version
210
- hash: 3
211
- segments:
213
+ requirements:
214
+ - - ! '>='
215
+ - !ruby/object:Gem::Version
216
+ version: '0'
217
+ segments:
212
218
  - 0
213
- version: "0"
214
- required_rubygems_version: !ruby/object:Gem::Requirement
219
+ hash: -1076555825220765929
220
+ required_rubygems_version: !ruby/object:Gem::Requirement
215
221
  none: false
216
- requirements:
217
- - - ">="
218
- - !ruby/object:Gem::Version
219
- hash: 23
220
- segments:
221
- - 1
222
- - 3
223
- - 6
222
+ requirements:
223
+ - - ! '>='
224
+ - !ruby/object:Gem::Version
224
225
  version: 1.3.6
225
226
  requirements: []
226
-
227
227
  rubyforge_project:
228
- rubygems_version: 1.6.2
228
+ rubygems_version: 1.8.24
229
229
  signing_key:
230
230
  specification_version: 3
231
231
  summary: Permalink handling
232
232
  test_files: []
233
-