postmarkdown 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6d1259762f115e6a4e14f0332a811e0021535cbc
4
+ data.tar.gz: 75c1cf02cdd1949f674fd295664e6aa723cc3854
5
+ SHA512:
6
+ metadata.gz: 314879f2b718f06915f50e76a4f01d8ee2913ee6a94c6f787a37edca586aa1c7d0404f6f545690014bf51d482abc5c6d198d35eef30087afb2935a01a585b73f
7
+ data.tar.gz: 7850455b8b7522e47eb06c6a34f3ab2f5b5f76292f500f7021a484f5ee6d67aa7837d54443b8ffee97142d59f1d8cc19e6f2b4f13f0f0e671f1ab4492a4063a7
data/Appraisals CHANGED
@@ -1,9 +1,11 @@
1
1
  appraise 'rails3_1' do
2
2
  gem 'rails', '~> 3.1.0'
3
- gem 'combustion', '~> 0.4.0'
4
3
  end
5
4
 
6
5
  appraise 'rails3_2' do
7
6
  gem 'rails', '~> 3.2.0'
8
- gem 'combustion', '~> 0.4.0'
7
+ end
8
+
9
+ appraise 'rails4_0' do
10
+ gem 'rails', '~> 4.0.2'
9
11
  end
data/app/models/post.rb CHANGED
@@ -10,7 +10,7 @@ class Post
10
10
  attr_reader :slug
11
11
 
12
12
  TIME_FORMAT = /-\d{6}/
13
- DATE_FORMAT = /\d{4}-\d{2}-\d{2}(#{TIME_FORMAT})?/
13
+ DATE_FORMAT = /\d{4}-\d{2}-\d{2}(?:#{TIME_FORMAT})?/
14
14
  SLUG_FORMAT = /[A-Za-z0-9_\-]+/
15
15
  EXTENSION_FORMAT = /\.[^.]+/
16
16
 
@@ -18,7 +18,10 @@ class Post
18
18
 
19
19
  def initialize(path)
20
20
  @path = path
21
- @date_str, _, @slug = File.basename(path).match(FILENAME_FORMAT).captures
21
+ @date_str, @slug = File.basename(path).match(FILENAME_FORMAT).try(:captures)
22
+ unless @date_str.present? && @slug.present?
23
+ raise "Invalid post filename: #{File.basename(path).inspect}"
24
+ end
22
25
  end
23
26
 
24
27
  def to_param
@@ -71,7 +74,7 @@ class Post
71
74
  delegate :year, :month, :day, :to => :date
72
75
 
73
76
  def timestamp
74
- date.to_time_in_current_zone
77
+ date.respond_to?(:in_time_zone) ? date.in_time_zone : date.to_time_in_current_zone
75
78
  end
76
79
  alias_method :last_modified, :timestamp
77
80
 
@@ -5,6 +5,5 @@ source "http://rubygems.org"
5
5
  gem "timecop", :require=>false
6
6
  gem "generator_spec", :require=>false
7
7
  gem "rails", "~> 3.1.0"
8
- gem "combustion", "~> 0.4.0"
9
8
 
10
9
  gemspec :path=>"../"
@@ -5,6 +5,5 @@ source "http://rubygems.org"
5
5
  gem "timecop", :require=>false
6
6
  gem "generator_spec", :require=>false
7
7
  gem "rails", "~> 3.2.0"
8
- gem "combustion", "~> 0.4.0"
9
8
 
10
9
  gemspec :path=>"../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "timecop", :require=>false
6
+ gem "generator_spec", :require=>false
7
+ gem "rails", "~> 4.0.2"
8
+
9
+ gemspec :path=>"../"
@@ -4,6 +4,7 @@ module Postmarkdown
4
4
  require 'gravtastic'
5
5
  require 'rdiscount'
6
6
  require 'nokogiri'
7
+ require 'action_view'
7
8
  require 'haml'
8
9
  require 'kaminari'
9
10
 
@@ -5,7 +5,7 @@ class ActionDispatch::Routing::Mapper
5
5
  options.reverse_merge!({ :as => :posts, :permalink_format => :day })
6
6
 
7
7
  get "/#{options[:as]}(/:year(/:month(/:day)))" => 'posts#index', :as => :posts, :constraints => { :year => /\d{4}/, :month => /\d{2}/, :day => /\d{2}/}
8
- get "/#{options[:as]}/feed" => 'posts#feed', :as => :posts_feed, :format => :xml
8
+ get "/#{options[:as]}/feed" => 'posts#feed', :as => :posts_feed, :defaults => {:format => :xml}
9
9
  get "/#{options[:as]}/*id" => 'posts#show', :as => :post, :constraints => { :id => postmarkdown_permalink_regex(options) }
10
10
 
11
11
  postmarkdown_feed_title(options[:as])
@@ -1,3 +1,3 @@
1
1
  module Postmarkdown
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
data/postmarkdown.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
22
  s.require_paths = ['lib', 'public']
23
23
 
24
- s.add_dependency 'rails', '~> 3.1'
24
+ s.add_dependency 'rails', ['>= 3.1', '< 5.0']
25
25
  s.add_dependency 'haml', ['>= 3.1', '< 5']
26
26
  s.add_dependency 'gravtastic'
27
27
  s.add_dependency 'nokogiri'
@@ -33,5 +33,5 @@ Gem::Specification.new do |s|
33
33
  s.add_development_dependency 'capybara', '~> 1.0.0.beta'
34
34
  s.add_development_dependency 'sqlite3'
35
35
  s.add_development_dependency 'delorean', '>= 0.2'
36
- s.add_development_dependency 'combustion', '~> 0.3.1'
36
+ s.add_development_dependency 'combustion', '~> 0.4.0'
37
37
  end
@@ -1,8 +1,11 @@
1
1
  Rails.application.class.configure do
2
2
  config.cache_classes = true
3
- config.whiny_nils = true
3
+ config.whiny_nils = true if Rails::VERSION::MAJOR < 4
4
+ config.secret_key_base = 'abc123' if Rails::VERSION::MAJOR >= 4
5
+ config.eager_load = false
4
6
  config.consider_all_requests_local = true
5
7
  config.action_controller.perform_caching = false
6
8
  config.action_dispatch.show_exceptions = false
7
9
  config.active_support.deprecation = :stderr
10
+ config.i18n.enforce_available_locales = true if I18n.respond_to? :enforce_available_locales
8
11
  end
@@ -6,7 +6,9 @@ describe Post do
6
6
  end
7
7
 
8
8
  it 'should not initialise with bad filename' do
9
- lambda { test_post 'missing-date-from-filename.markdown' }.should raise_error
9
+ lambda {
10
+ test_post 'missing-date-from-filename.markdown'
11
+ }.should raise_error 'Invalid post filename: "missing-date-from-filename.markdown"'
10
12
  end
11
13
 
12
14
  context 'with missing file' do
data/spec/spec_helper.rb CHANGED
@@ -8,6 +8,7 @@ require 'postmarkdown'
8
8
 
9
9
  require 'combustion'
10
10
  Combustion.initialize! :action_controller, :action_view, :sprockets
11
+ require 'active_record/version'
11
12
 
12
13
  require 'capybara/rspec'
13
14
  require 'rspec/rails'
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postmarkdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
5
- prerelease:
4
+ version: 0.0.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jason Weathered
@@ -12,206 +11,188 @@ authors:
12
11
  autorequire:
13
12
  bindir: bin
14
13
  cert_chain: []
15
- date: 2013-03-22 00:00:00.000000000 Z
14
+ date: 2014-02-13 00:00:00.000000000 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: rails
19
18
  requirement: !ruby/object:Gem::Requirement
20
- none: false
21
19
  requirements:
22
- - - ~>
20
+ - - ">="
23
21
  - !ruby/object:Gem::Version
24
22
  version: '3.1'
23
+ - - "<"
24
+ - !ruby/object:Gem::Version
25
+ version: '5.0'
25
26
  type: :runtime
26
27
  prerelease: false
27
28
  version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
29
  requirements:
30
- - - ~>
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: '3.1'
33
+ - - "<"
34
+ - !ruby/object:Gem::Version
35
+ version: '5.0'
33
36
  - !ruby/object:Gem::Dependency
34
37
  name: haml
35
38
  requirement: !ruby/object:Gem::Requirement
36
- none: false
37
39
  requirements:
38
- - - ! '>='
40
+ - - ">="
39
41
  - !ruby/object:Gem::Version
40
42
  version: '3.1'
41
- - - <
43
+ - - "<"
42
44
  - !ruby/object:Gem::Version
43
45
  version: '5'
44
46
  type: :runtime
45
47
  prerelease: false
46
48
  version_requirements: !ruby/object:Gem::Requirement
47
- none: false
48
49
  requirements:
49
- - - ! '>='
50
+ - - ">="
50
51
  - !ruby/object:Gem::Version
51
52
  version: '3.1'
52
- - - <
53
+ - - "<"
53
54
  - !ruby/object:Gem::Version
54
55
  version: '5'
55
56
  - !ruby/object:Gem::Dependency
56
57
  name: gravtastic
57
58
  requirement: !ruby/object:Gem::Requirement
58
- none: false
59
59
  requirements:
60
- - - ! '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
- none: false
67
66
  requirements:
68
- - - ! '>='
67
+ - - ">="
69
68
  - !ruby/object:Gem::Version
70
69
  version: '0'
71
70
  - !ruby/object:Gem::Dependency
72
71
  name: nokogiri
73
72
  requirement: !ruby/object:Gem::Requirement
74
- none: false
75
73
  requirements:
76
- - - ! '>='
74
+ - - ">="
77
75
  - !ruby/object:Gem::Version
78
76
  version: '0'
79
77
  type: :runtime
80
78
  prerelease: false
81
79
  version_requirements: !ruby/object:Gem::Requirement
82
- none: false
83
80
  requirements:
84
- - - ! '>='
81
+ - - ">="
85
82
  - !ruby/object:Gem::Version
86
83
  version: '0'
87
84
  - !ruby/object:Gem::Dependency
88
85
  name: rdiscount
89
86
  requirement: !ruby/object:Gem::Requirement
90
- none: false
91
87
  requirements:
92
- - - ! '>='
88
+ - - ">="
93
89
  - !ruby/object:Gem::Version
94
90
  version: '0'
95
91
  type: :runtime
96
92
  prerelease: false
97
93
  version_requirements: !ruby/object:Gem::Requirement
98
- none: false
99
94
  requirements:
100
- - - ! '>='
95
+ - - ">="
101
96
  - !ruby/object:Gem::Version
102
97
  version: '0'
103
98
  - !ruby/object:Gem::Dependency
104
99
  name: kaminari
105
100
  requirement: !ruby/object:Gem::Requirement
106
- none: false
107
101
  requirements:
108
- - - ! '>='
102
+ - - ">="
109
103
  - !ruby/object:Gem::Version
110
104
  version: '0'
111
105
  type: :runtime
112
106
  prerelease: false
113
107
  version_requirements: !ruby/object:Gem::Requirement
114
- none: false
115
108
  requirements:
116
- - - ! '>='
109
+ - - ">="
117
110
  - !ruby/object:Gem::Version
118
111
  version: '0'
119
112
  - !ruby/object:Gem::Dependency
120
113
  name: appraisal
121
114
  requirement: !ruby/object:Gem::Requirement
122
- none: false
123
115
  requirements:
124
- - - ! '>='
116
+ - - ">="
125
117
  - !ruby/object:Gem::Version
126
118
  version: '0'
127
119
  type: :development
128
120
  prerelease: false
129
121
  version_requirements: !ruby/object:Gem::Requirement
130
- none: false
131
122
  requirements:
132
- - - ! '>='
123
+ - - ">="
133
124
  - !ruby/object:Gem::Version
134
125
  version: '0'
135
126
  - !ruby/object:Gem::Dependency
136
127
  name: rspec-rails
137
128
  requirement: !ruby/object:Gem::Requirement
138
- none: false
139
129
  requirements:
140
- - - ~>
130
+ - - "~>"
141
131
  - !ruby/object:Gem::Version
142
132
  version: '2.8'
143
133
  type: :development
144
134
  prerelease: false
145
135
  version_requirements: !ruby/object:Gem::Requirement
146
- none: false
147
136
  requirements:
148
- - - ~>
137
+ - - "~>"
149
138
  - !ruby/object:Gem::Version
150
139
  version: '2.8'
151
140
  - !ruby/object:Gem::Dependency
152
141
  name: capybara
153
142
  requirement: !ruby/object:Gem::Requirement
154
- none: false
155
143
  requirements:
156
- - - ~>
144
+ - - "~>"
157
145
  - !ruby/object:Gem::Version
158
146
  version: 1.0.0.beta
159
147
  type: :development
160
148
  prerelease: false
161
149
  version_requirements: !ruby/object:Gem::Requirement
162
- none: false
163
150
  requirements:
164
- - - ~>
151
+ - - "~>"
165
152
  - !ruby/object:Gem::Version
166
153
  version: 1.0.0.beta
167
154
  - !ruby/object:Gem::Dependency
168
155
  name: sqlite3
169
156
  requirement: !ruby/object:Gem::Requirement
170
- none: false
171
157
  requirements:
172
- - - ! '>='
158
+ - - ">="
173
159
  - !ruby/object:Gem::Version
174
160
  version: '0'
175
161
  type: :development
176
162
  prerelease: false
177
163
  version_requirements: !ruby/object:Gem::Requirement
178
- none: false
179
164
  requirements:
180
- - - ! '>='
165
+ - - ">="
181
166
  - !ruby/object:Gem::Version
182
167
  version: '0'
183
168
  - !ruby/object:Gem::Dependency
184
169
  name: delorean
185
170
  requirement: !ruby/object:Gem::Requirement
186
- none: false
187
171
  requirements:
188
- - - ! '>='
172
+ - - ">="
189
173
  - !ruby/object:Gem::Version
190
174
  version: '0.2'
191
175
  type: :development
192
176
  prerelease: false
193
177
  version_requirements: !ruby/object:Gem::Requirement
194
- none: false
195
178
  requirements:
196
- - - ! '>='
179
+ - - ">="
197
180
  - !ruby/object:Gem::Version
198
181
  version: '0.2'
199
182
  - !ruby/object:Gem::Dependency
200
183
  name: combustion
201
184
  requirement: !ruby/object:Gem::Requirement
202
- none: false
203
185
  requirements:
204
- - - ~>
186
+ - - "~>"
205
187
  - !ruby/object:Gem::Version
206
- version: 0.3.1
188
+ version: 0.4.0
207
189
  type: :development
208
190
  prerelease: false
209
191
  version_requirements: !ruby/object:Gem::Requirement
210
- none: false
211
192
  requirements:
212
- - - ~>
193
+ - - "~>"
213
194
  - !ruby/object:Gem::Version
214
- version: 0.3.1
195
+ version: 0.4.0
215
196
  description: A simple Rails blog engine powered by markdown.
216
197
  email:
217
198
  - jason.weathered@ennova.com.au
@@ -222,10 +203,10 @@ executables: []
222
203
  extensions: []
223
204
  extra_rdoc_files: []
224
205
  files:
225
- - .gitignore
226
- - .rspec
227
- - .rvmrc
228
- - .travis.yml
206
+ - ".gitignore"
207
+ - ".rspec"
208
+ - ".rvmrc"
209
+ - ".travis.yml"
229
210
  - Appraisals
230
211
  - Gemfile
231
212
  - README.markdown
@@ -244,6 +225,7 @@ files:
244
225
  - gemfiles/rails3_0.gemfile
245
226
  - gemfiles/rails3_1.gemfile
246
227
  - gemfiles/rails3_2.gemfile
228
+ - gemfiles/rails4_0.gemfile
247
229
  - lib/generators/postmarkdown/install_generator.rb
248
230
  - lib/generators/postmarkdown/override_generator.rb
249
231
  - lib/generators/postmarkdown/post_generator.rb
@@ -294,34 +276,27 @@ files:
294
276
  homepage: ''
295
277
  licenses:
296
278
  - MIT
279
+ metadata: {}
297
280
  post_install_message:
298
281
  rdoc_options: []
299
282
  require_paths:
300
283
  - lib
301
284
  - public
302
285
  required_ruby_version: !ruby/object:Gem::Requirement
303
- none: false
304
286
  requirements:
305
- - - ! '>='
287
+ - - ">="
306
288
  - !ruby/object:Gem::Version
307
289
  version: '0'
308
- segments:
309
- - 0
310
- hash: 3995996797349439592
311
290
  required_rubygems_version: !ruby/object:Gem::Requirement
312
- none: false
313
291
  requirements:
314
- - - ! '>='
292
+ - - ">="
315
293
  - !ruby/object:Gem::Version
316
294
  version: '0'
317
- segments:
318
- - 0
319
- hash: 3995996797349439592
320
295
  requirements: []
321
296
  rubyforge_project: postmarkdown
322
- rubygems_version: 1.8.24
297
+ rubygems_version: 2.2.0
323
298
  signing_key:
324
- specification_version: 3
299
+ specification_version: 4
325
300
  summary: A simple Rails blog engine powered by markdown.
326
301
  test_files:
327
302
  - spec/helpers/post_helper_spec.rb