frank 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/frank.gemspec +3 -4
  2. data/lib/frank/base.rb +10 -18
  3. metadata +109 -108
data/frank.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{frank}
8
- s.version = "1.0.6"
8
+ s.version = "1.0.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["blahed", "nwah"]
12
- s.date = %q{2010-12-09}
12
+ s.date = %q{2011-01-20}
13
13
  s.default_executable = %q{frank}
14
14
  s.description = %q{Rapidly develop static sites using any supported templating language}
15
15
  s.email = %q{travis.dunn@thisismedium.com}
@@ -102,7 +102,7 @@ Gem::Specification.new do |s|
102
102
  ]
103
103
  s.homepage = %q{http://github.com/blahed/frank}
104
104
  s.require_paths = ["lib"]
105
- s.rubygems_version = %q{1.3.7}
105
+ s.rubygems_version = %q{1.4.0}
106
106
  s.summary = %q{Static Site Non-Framework}
107
107
  s.test_files = [
108
108
  "spec/base_spec.rb",
@@ -116,7 +116,6 @@ Gem::Specification.new do |s|
116
116
  ]
117
117
 
118
118
  if s.respond_to? :specification_version then
119
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
120
119
  s.specification_version = 3
121
120
 
122
121
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
data/lib/frank/base.rb CHANGED
@@ -6,7 +6,7 @@ require 'frank/middleware/statik'
6
6
  require 'frank/middleware/refresh'
7
7
 
8
8
  module Frank
9
- VERSION = '1.0.6'
9
+ VERSION = '1.0.7'
10
10
  extend Frank::Upgrades
11
11
 
12
12
  module Render; end
@@ -105,14 +105,14 @@ module Frank
105
105
  # let tilt determine the template handler
106
106
  # and return some template markup
107
107
  if layout.nil?
108
- tilt(page, ext, template, locals)
108
+ tilt(page, ext, template, template_path, locals)
109
109
  else
110
110
  layout_path = File.join(Frank.root, Frank.layouts_folder, layout)
111
111
  # add layout_path to locals
112
112
  raise Frank::TemplateError, "Layout not found #{layout_path}" unless File.exist? layout_path
113
113
 
114
- page_content = tilt(page, ext, template, locals)
115
- tilt(page, File.extname(layout), layout_path, locals) do
114
+ page_content = tilt(page, ext, template, template_path, locals)
115
+ tilt(page, File.extname(layout), nil, layout_path, locals) do
116
116
  page_content
117
117
  end
118
118
  end
@@ -139,16 +139,13 @@ module Frank
139
139
  end
140
140
 
141
141
  # lookup the original ext for given template path
142
- # TODO: make non-ugly
143
142
  def ext_from_handler(extension)
144
- orig_ext = nil
145
- TMPL_EXTS.each do |ext, engines|
146
- orig_ext = ext.to_s if engines.include? extension[1..-1]
143
+ ext = extension[1..-1]
144
+ TMPL_EXTS.each do |orig_ext, engines|
145
+ return orig_ext.to_s if engines.include? ext
147
146
  end
148
- orig_ext
149
147
  end
150
148
 
151
-
152
149
  # reverse walks the layouts folder until we find a layout
153
150
  # returns nil if layout is not found
154
151
  def layout_for(path)
@@ -184,14 +181,9 @@ module Frank
184
181
  end
185
182
 
186
183
  # render a page using tilt and get the result template markup back
187
- def tilt(page, ext, source, locals={}, &block)
188
- Tilt[ext].new do
189
- source = source.to_str if source.respond_to?(:to_str)
190
- if source.match(/^[^\n]+$/) && File.exist?(source)
191
- File.read(source)
192
- else
193
- source
194
- end
184
+ def tilt(page, ext, source, filename, locals={}, &block)
185
+ Tilt[ext].new(filename) do
186
+ source || File.read(filename)
195
187
  end.render(page, locals=locals, &block)
196
188
  end
197
189
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frank
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
4
+ hash: 25
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 6
10
- version: 1.0.6
9
+ - 7
10
+ version: 1.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - blahed
@@ -16,11 +16,14 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-12-09 00:00:00 -05:00
19
+ date: 2011-01-20 00:00:00 -05:00
20
20
  default_executable: frank
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
- requirement: &id001 !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ name: rack
25
+ type: :runtime
26
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
27
  none: false
25
28
  requirements:
26
29
  - - ">="
@@ -30,29 +33,30 @@ dependencies:
30
33
  - 1
31
34
  - 0
32
35
  version: "1.0"
33
- type: :runtime
34
- name: rack
35
- prerelease: false
36
- version_requirements: *id001
36
+ requirement: *id001
37
37
  - !ruby/object:Gem::Dependency
38
- requirement: &id002 !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ name: mongrel
40
+ type: :runtime
41
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
42
  none: false
40
43
  requirements:
41
44
  - - ">="
42
45
  - !ruby/object:Gem::Version
43
- hash: -1876988191
46
+ hash: 1923831981
44
47
  segments:
45
48
  - 1
46
49
  - 2
47
50
  - 0
48
- - pre2
51
+ - pre
52
+ - 2
49
53
  version: 1.2.0.pre2
50
- type: :runtime
51
- name: mongrel
52
- prerelease: false
53
- version_requirements: *id002
54
+ requirement: *id002
54
55
  - !ruby/object:Gem::Dependency
55
- requirement: &id003 !ruby/object:Gem::Requirement
56
+ prerelease: false
57
+ name: haml
58
+ type: :runtime
59
+ version_requirements: &id003 !ruby/object:Gem::Requirement
56
60
  none: false
57
61
  requirements:
58
62
  - - ">="
@@ -62,12 +66,12 @@ dependencies:
62
66
  - 3
63
67
  - 0
64
68
  version: "3.0"
65
- type: :runtime
66
- name: haml
67
- prerelease: false
68
- version_requirements: *id003
69
+ requirement: *id003
69
70
  - !ruby/object:Gem::Dependency
70
- requirement: &id004 !ruby/object:Gem::Requirement
71
+ prerelease: false
72
+ name: tilt
73
+ type: :runtime
74
+ version_requirements: &id004 !ruby/object:Gem::Requirement
71
75
  none: false
72
76
  requirements:
73
77
  - - "="
@@ -77,12 +81,12 @@ dependencies:
77
81
  - 0
78
82
  - 9
79
83
  version: "0.9"
80
- type: :runtime
81
- name: tilt
82
- prerelease: false
83
- version_requirements: *id004
84
+ requirement: *id004
84
85
  - !ruby/object:Gem::Dependency
85
- requirement: &id005 !ruby/object:Gem::Requirement
86
+ prerelease: false
87
+ name: net-ssh
88
+ type: :runtime
89
+ version_requirements: &id005 !ruby/object:Gem::Requirement
86
90
  none: false
87
91
  requirements:
88
92
  - - ">="
@@ -92,12 +96,12 @@ dependencies:
92
96
  - 2
93
97
  - 0
94
98
  version: "2.0"
95
- type: :runtime
96
- name: net-ssh
97
- prerelease: false
98
- version_requirements: *id005
99
+ requirement: *id005
99
100
  - !ruby/object:Gem::Dependency
100
- requirement: &id006 !ruby/object:Gem::Requirement
101
+ prerelease: false
102
+ name: net-scp
103
+ type: :runtime
104
+ version_requirements: &id006 !ruby/object:Gem::Requirement
101
105
  none: false
102
106
  requirements:
103
107
  - - ">="
@@ -107,12 +111,12 @@ dependencies:
107
111
  - 1
108
112
  - 0
109
113
  version: "1.0"
110
- type: :runtime
111
- name: net-scp
112
- prerelease: false
113
- version_requirements: *id006
114
+ requirement: *id006
114
115
  - !ruby/object:Gem::Dependency
115
- requirement: &id007 !ruby/object:Gem::Requirement
116
+ prerelease: false
117
+ name: jeweler
118
+ type: :development
119
+ version_requirements: &id007 !ruby/object:Gem::Requirement
116
120
  none: false
117
121
  requirements:
118
122
  - - ">="
@@ -121,12 +125,12 @@ dependencies:
121
125
  segments:
122
126
  - 0
123
127
  version: "0"
124
- type: :development
125
- name: jeweler
126
- prerelease: false
127
- version_requirements: *id007
128
+ requirement: *id007
128
129
  - !ruby/object:Gem::Dependency
129
- requirement: &id008 !ruby/object:Gem::Requirement
130
+ prerelease: false
131
+ name: rspec
132
+ type: :development
133
+ version_requirements: &id008 !ruby/object:Gem::Requirement
130
134
  none: false
131
135
  requirements:
132
136
  - - ">="
@@ -139,12 +143,12 @@ dependencies:
139
143
  - beta
140
144
  - 19
141
145
  version: 2.0.0.beta.19
142
- type: :development
143
- name: rspec
144
- prerelease: false
145
- version_requirements: *id008
146
+ requirement: *id008
146
147
  - !ruby/object:Gem::Dependency
147
- requirement: &id009 !ruby/object:Gem::Requirement
148
+ prerelease: false
149
+ name: rack-test
150
+ type: :development
151
+ version_requirements: &id009 !ruby/object:Gem::Requirement
148
152
  none: false
149
153
  requirements:
150
154
  - - ">="
@@ -154,12 +158,12 @@ dependencies:
154
158
  - 0
155
159
  - 5
156
160
  version: "0.5"
157
- type: :development
158
- name: rack-test
159
- prerelease: false
160
- version_requirements: *id009
161
+ requirement: *id009
161
162
  - !ruby/object:Gem::Dependency
162
- requirement: &id010 !ruby/object:Gem::Requirement
163
+ prerelease: false
164
+ name: rake
165
+ type: :development
166
+ version_requirements: &id010 !ruby/object:Gem::Requirement
163
167
  none: false
164
168
  requirements:
165
169
  - - ">="
@@ -168,12 +172,12 @@ dependencies:
168
172
  segments:
169
173
  - 0
170
174
  version: "0"
171
- type: :development
172
- name: rake
173
- prerelease: false
174
- version_requirements: *id010
175
+ requirement: *id010
175
176
  - !ruby/object:Gem::Dependency
176
- requirement: &id011 !ruby/object:Gem::Requirement
177
+ prerelease: false
178
+ name: contest
179
+ type: :development
180
+ version_requirements: &id011 !ruby/object:Gem::Requirement
177
181
  none: false
178
182
  requirements:
179
183
  - - ">="
@@ -182,12 +186,12 @@ dependencies:
182
186
  segments:
183
187
  - 0
184
188
  version: "0"
185
- type: :development
186
- name: contest
187
- prerelease: false
188
- version_requirements: *id011
189
+ requirement: *id011
189
190
  - !ruby/object:Gem::Dependency
190
- requirement: &id012 !ruby/object:Gem::Requirement
191
+ prerelease: false
192
+ name: builder
193
+ type: :development
194
+ version_requirements: &id012 !ruby/object:Gem::Requirement
191
195
  none: false
192
196
  requirements:
193
197
  - - ">="
@@ -196,12 +200,12 @@ dependencies:
196
200
  segments:
197
201
  - 0
198
202
  version: "0"
199
- type: :development
200
- name: builder
201
- prerelease: false
202
- version_requirements: *id012
203
+ requirement: *id012
203
204
  - !ruby/object:Gem::Dependency
204
- requirement: &id013 !ruby/object:Gem::Requirement
205
+ prerelease: false
206
+ name: erubis
207
+ type: :development
208
+ version_requirements: &id013 !ruby/object:Gem::Requirement
205
209
  none: false
206
210
  requirements:
207
211
  - - ">="
@@ -210,12 +214,12 @@ dependencies:
210
214
  segments:
211
215
  - 0
212
216
  version: "0"
213
- type: :development
214
- name: erubis
215
- prerelease: false
216
- version_requirements: *id013
217
+ requirement: *id013
217
218
  - !ruby/object:Gem::Dependency
218
- requirement: &id014 !ruby/object:Gem::Requirement
219
+ prerelease: false
220
+ name: compass
221
+ type: :development
222
+ version_requirements: &id014 !ruby/object:Gem::Requirement
219
223
  none: false
220
224
  requirements:
221
225
  - - ">="
@@ -226,12 +230,12 @@ dependencies:
226
230
  - 10
227
231
  - 2
228
232
  version: 0.10.2
229
- type: :development
230
- name: compass
231
- prerelease: false
232
- version_requirements: *id014
233
+ requirement: *id014
233
234
  - !ruby/object:Gem::Dependency
234
- requirement: &id015 !ruby/object:Gem::Requirement
235
+ prerelease: false
236
+ name: rdiscount
237
+ type: :development
238
+ version_requirements: &id015 !ruby/object:Gem::Requirement
235
239
  none: false
236
240
  requirements:
237
241
  - - ">="
@@ -240,12 +244,12 @@ dependencies:
240
244
  segments:
241
245
  - 0
242
246
  version: "0"
243
- type: :development
244
- name: rdiscount
245
- prerelease: false
246
- version_requirements: *id015
247
+ requirement: *id015
247
248
  - !ruby/object:Gem::Dependency
248
- requirement: &id016 !ruby/object:Gem::Requirement
249
+ prerelease: false
250
+ name: liquid
251
+ type: :development
252
+ version_requirements: &id016 !ruby/object:Gem::Requirement
249
253
  none: false
250
254
  requirements:
251
255
  - - ">="
@@ -254,12 +258,12 @@ dependencies:
254
258
  segments:
255
259
  - 0
256
260
  version: "0"
257
- type: :development
258
- name: liquid
259
- prerelease: false
260
- version_requirements: *id016
261
+ requirement: *id016
261
262
  - !ruby/object:Gem::Dependency
262
- requirement: &id017 !ruby/object:Gem::Requirement
263
+ prerelease: false
264
+ name: less
265
+ type: :development
266
+ version_requirements: &id017 !ruby/object:Gem::Requirement
263
267
  none: false
264
268
  requirements:
265
269
  - - ">="
@@ -268,12 +272,12 @@ dependencies:
268
272
  segments:
269
273
  - 0
270
274
  version: "0"
271
- type: :development
272
- name: less
273
- prerelease: false
274
- version_requirements: *id017
275
+ requirement: *id017
275
276
  - !ruby/object:Gem::Dependency
276
- requirement: &id018 !ruby/object:Gem::Requirement
277
+ prerelease: false
278
+ name: coffee-script
279
+ type: :development
280
+ version_requirements: &id018 !ruby/object:Gem::Requirement
277
281
  none: false
278
282
  requirements:
279
283
  - - ">="
@@ -282,12 +286,12 @@ dependencies:
282
286
  segments:
283
287
  - 0
284
288
  version: "0"
285
- type: :development
286
- name: coffee-script
287
- prerelease: false
288
- version_requirements: *id018
289
+ requirement: *id018
289
290
  - !ruby/object:Gem::Dependency
290
- requirement: &id019 !ruby/object:Gem::Requirement
291
+ prerelease: false
292
+ name: RedCloth
293
+ type: :development
294
+ version_requirements: &id019 !ruby/object:Gem::Requirement
291
295
  none: false
292
296
  requirements:
293
297
  - - ">="
@@ -296,12 +300,12 @@ dependencies:
296
300
  segments:
297
301
  - 0
298
302
  version: "0"
299
- type: :development
300
- name: RedCloth
301
- prerelease: false
302
- version_requirements: *id019
303
+ requirement: *id019
303
304
  - !ruby/object:Gem::Dependency
304
- requirement: &id020 !ruby/object:Gem::Requirement
305
+ prerelease: false
306
+ name: ruby-debug
307
+ type: :development
308
+ version_requirements: &id020 !ruby/object:Gem::Requirement
305
309
  none: false
306
310
  requirements:
307
311
  - - ">="
@@ -310,10 +314,7 @@ dependencies:
310
314
  segments:
311
315
  - 0
312
316
  version: "0"
313
- type: :development
314
- name: ruby-debug
315
- prerelease: false
316
- version_requirements: *id020
317
+ requirement: *id020
317
318
  description: Rapidly develop static sites using any supported templating language
318
319
  email: travis.dunn@thisismedium.com
319
320
  executables:
@@ -434,7 +435,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
434
435
  requirements: []
435
436
 
436
437
  rubyforge_project:
437
- rubygems_version: 1.3.7
438
+ rubygems_version: 1.4.0
438
439
  signing_key:
439
440
  specification_version: 3
440
441
  summary: Static Site Non-Framework