serve 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,13 +36,15 @@ describe Serve::Router do
36
36
 
37
37
  it 'should resolve files with various extensions' do
38
38
  @root = File.dirname(__FILE__) + '/../tmp/'
39
+ Dir[File.join(@root, "test.*")].each do |f|
40
+ FileUtils.rm(f)
41
+ end
39
42
  random_extension = %w(a b c d e f g).shuffle[1..4].join
40
43
  path = "test"
41
44
  full_path = path + "." + random_extension
42
45
  FileUtils.touch(@root + full_path)
43
46
  resolve(path).should == full_path
44
47
  resolve(path + "/").should == full_path
45
- FileUtils.rm(@root + full_path)
46
48
  end
47
49
 
48
50
  it 'should resolve files without case sensitivity' do
@@ -57,4 +59,4 @@ describe Serve::Router do
57
59
  Serve::Router.resolve(@root, name)
58
60
  end
59
61
 
60
- end
62
+ end
@@ -3,32 +3,32 @@
3
3
  # View helpers allow you keep templates clean.
4
4
  #
5
5
  module ViewHelpers
6
-
6
+
7
7
  # Example helper method
8
8
  def hello(name)
9
9
  "Hello \#{name}!"
10
10
  end
11
-
11
+
12
12
  # Handy for hiding a block of unfinished code
13
13
  def hidden(&block)
14
14
  #no-op
15
15
  end
16
-
16
+
17
17
  # Shorthand for referencing images in the images folder
18
18
  def image(name, options = {})
19
19
  path = "/images/\#{name}"
20
20
  path += ".png" unless path.match(/\.[A-za-z]{3,4}$/)
21
21
  image_tag(name, {:alt => ""}.update(options))
22
22
  end
23
-
23
+
24
24
  # Calculate the years for a copyright
25
25
  def copyright_years(start_year)
26
26
  end_year = Date.today.year
27
27
  if start_year == end_year
28
- "\#{start_year}"
28
+ "#{start_year}"
29
29
  else
30
- "\#{start_year}–\#{end_year}"
30
+ "#{start_year}–#{end_year}"
31
31
  end
32
32
  end
33
-
33
+
34
34
  end
metadata CHANGED
@@ -1,250 +1,350 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: serve
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.2
4
5
  prerelease:
5
- version: 1.5.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - John W. Long
9
9
  - Adam I. Williams
10
10
  - Robert Evans
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
-
15
- date: 2011-07-13 00:00:00 -04:00
16
- default_executable: serve
17
- dependencies:
18
- - !ruby/object:Gem::Dependency
14
+ date: 2013-02-23 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
19
17
  name: rack
20
- requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirement: !ruby/object:Gem::Requirement
21
19
  none: false
22
- requirements:
20
+ requirements:
23
21
  - - ~>
24
- - !ruby/object:Gem::Version
25
- version: "1.2"
22
+ - !ruby/object:Gem::Version
23
+ version: 1.5.2
26
24
  type: :runtime
27
25
  prerelease: false
28
- version_requirements: *id001
29
- - !ruby/object:Gem::Dependency
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ~>
30
+ - !ruby/object:Gem::Version
31
+ version: 1.5.2
32
+ - !ruby/object:Gem::Dependency
30
33
  name: rack-test
31
- requirement: &id002 !ruby/object:Gem::Requirement
34
+ requirement: !ruby/object:Gem::Requirement
32
35
  none: false
33
- requirements:
36
+ requirements:
34
37
  - - ~>
35
- - !ruby/object:Gem::Version
36
- version: "0.5"
38
+ - !ruby/object:Gem::Version
39
+ version: 0.6.2
37
40
  type: :runtime
38
41
  prerelease: false
39
- version_requirements: *id002
40
- - !ruby/object:Gem::Dependency
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 0.6.2
48
+ - !ruby/object:Gem::Dependency
41
49
  name: tilt
42
- requirement: &id003 !ruby/object:Gem::Requirement
50
+ requirement: !ruby/object:Gem::Requirement
43
51
  none: false
44
- requirements:
52
+ requirements:
45
53
  - - ~>
46
- - !ruby/object:Gem::Version
47
- version: "1.3"
54
+ - !ruby/object:Gem::Version
55
+ version: 1.3.3
48
56
  type: :runtime
49
57
  prerelease: false
50
- version_requirements: *id003
51
- - !ruby/object:Gem::Dependency
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ~>
62
+ - !ruby/object:Gem::Version
63
+ version: 1.3.3
64
+ - !ruby/object:Gem::Dependency
52
65
  name: activesupport
53
- requirement: &id004 !ruby/object:Gem::Requirement
66
+ requirement: !ruby/object:Gem::Requirement
54
67
  none: false
55
- requirements:
68
+ requirements:
56
69
  - - ~>
57
- - !ruby/object:Gem::Version
58
- version: "3.0"
70
+ - !ruby/object:Gem::Version
71
+ version: 3.2.12
59
72
  type: :runtime
60
73
  prerelease: false
61
- version_requirements: *id004
62
- - !ruby/object:Gem::Dependency
74
+ version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ~>
78
+ - !ruby/object:Gem::Version
79
+ version: 3.2.12
80
+ - !ruby/object:Gem::Dependency
63
81
  name: tzinfo
64
- requirement: &id005 !ruby/object:Gem::Requirement
82
+ requirement: !ruby/object:Gem::Requirement
65
83
  none: false
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: "0"
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
70
88
  type: :runtime
71
89
  prerelease: false
72
- version_requirements: *id005
73
- - !ruby/object:Gem::Dependency
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ - !ruby/object:Gem::Dependency
74
97
  name: i18n
75
- requirement: &id006 !ruby/object:Gem::Requirement
98
+ requirement: !ruby/object:Gem::Requirement
76
99
  none: false
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- version: "0"
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
81
104
  type: :runtime
82
105
  prerelease: false
83
- version_requirements: *id006
84
- - !ruby/object:Gem::Dependency
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
85
113
  name: rake
86
- requirement: &id007 !ruby/object:Gem::Requirement
114
+ requirement: !ruby/object:Gem::Requirement
87
115
  none: false
88
- requirements:
116
+ requirements:
89
117
  - - ~>
90
- - !ruby/object:Gem::Version
91
- version: 0.9.0
118
+ - !ruby/object:Gem::Version
119
+ version: 10.0.3
92
120
  type: :development
93
121
  prerelease: false
94
- version_requirements: *id007
95
- - !ruby/object:Gem::Dependency
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ~>
126
+ - !ruby/object:Gem::Version
127
+ version: 10.0.3
128
+ - !ruby/object:Gem::Dependency
96
129
  name: rdoc
97
- requirement: &id008 !ruby/object:Gem::Requirement
130
+ requirement: !ruby/object:Gem::Requirement
98
131
  none: false
99
- requirements:
132
+ requirements:
100
133
  - - ~>
101
- - !ruby/object:Gem::Version
102
- version: 3.8.0
134
+ - !ruby/object:Gem::Version
135
+ version: 3.12.1
103
136
  type: :development
104
137
  prerelease: false
105
- version_requirements: *id008
106
- - !ruby/object:Gem::Dependency
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ~>
142
+ - !ruby/object:Gem::Version
143
+ version: 3.12.1
144
+ - !ruby/object:Gem::Dependency
107
145
  name: rspec
108
- requirement: &id009 !ruby/object:Gem::Requirement
146
+ requirement: !ruby/object:Gem::Requirement
109
147
  none: false
110
- requirements:
148
+ requirements:
111
149
  - - ~>
112
- - !ruby/object:Gem::Version
113
- version: 2.6.0
150
+ - !ruby/object:Gem::Version
151
+ version: 2.12.0
114
152
  type: :development
115
153
  prerelease: false
116
- version_requirements: *id009
117
- - !ruby/object:Gem::Dependency
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ none: false
156
+ requirements:
157
+ - - ~>
158
+ - !ruby/object:Gem::Version
159
+ version: 2.12.0
160
+ - !ruby/object:Gem::Dependency
118
161
  name: jeweler
119
- requirement: &id010 !ruby/object:Gem::Requirement
162
+ requirement: !ruby/object:Gem::Requirement
120
163
  none: false
121
- requirements:
164
+ requirements:
122
165
  - - ~>
123
- - !ruby/object:Gem::Version
166
+ - !ruby/object:Gem::Version
124
167
  version: 1.6.4
125
168
  type: :development
126
169
  prerelease: false
127
- version_requirements: *id010
128
- - !ruby/object:Gem::Dependency
170
+ version_requirements: !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - ~>
174
+ - !ruby/object:Gem::Version
175
+ version: 1.6.4
176
+ - !ruby/object:Gem::Dependency
129
177
  name: haml
130
- requirement: &id011 !ruby/object:Gem::Requirement
178
+ requirement: !ruby/object:Gem::Requirement
131
179
  none: false
132
- requirements:
180
+ requirements:
133
181
  - - ~>
134
- - !ruby/object:Gem::Version
135
- version: 3.1.1
182
+ - !ruby/object:Gem::Version
183
+ version: 3.1.7
136
184
  type: :development
137
185
  prerelease: false
138
- version_requirements: *id011
139
- - !ruby/object:Gem::Dependency
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ none: false
188
+ requirements:
189
+ - - ~>
190
+ - !ruby/object:Gem::Version
191
+ version: 3.1.7
192
+ - !ruby/object:Gem::Dependency
140
193
  name: sass
141
- requirement: &id012 !ruby/object:Gem::Requirement
194
+ requirement: !ruby/object:Gem::Requirement
142
195
  none: false
143
- requirements:
196
+ requirements:
144
197
  - - ~>
145
- - !ruby/object:Gem::Version
146
- version: 3.1.1
198
+ - !ruby/object:Gem::Version
199
+ version: 3.2.5
147
200
  type: :development
148
201
  prerelease: false
149
- version_requirements: *id012
150
- - !ruby/object:Gem::Dependency
202
+ version_requirements: !ruby/object:Gem::Requirement
203
+ none: false
204
+ requirements:
205
+ - - ~>
206
+ - !ruby/object:Gem::Version
207
+ version: 3.2.5
208
+ - !ruby/object:Gem::Dependency
151
209
  name: compass
152
- requirement: &id013 !ruby/object:Gem::Requirement
210
+ requirement: !ruby/object:Gem::Requirement
153
211
  none: false
154
- requirements:
212
+ requirements:
155
213
  - - ~>
156
- - !ruby/object:Gem::Version
157
- version: 0.11.1
214
+ - !ruby/object:Gem::Version
215
+ version: 0.12.2
158
216
  type: :development
159
217
  prerelease: false
160
- version_requirements: *id013
161
- - !ruby/object:Gem::Dependency
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ none: false
220
+ requirements:
221
+ - - ~>
222
+ - !ruby/object:Gem::Version
223
+ version: 0.12.2
224
+ - !ruby/object:Gem::Dependency
162
225
  name: slim
163
- requirement: &id014 !ruby/object:Gem::Requirement
226
+ requirement: !ruby/object:Gem::Requirement
164
227
  none: false
165
- requirements:
228
+ requirements:
166
229
  - - ~>
167
- - !ruby/object:Gem::Version
168
- version: 0.9.4
230
+ - !ruby/object:Gem::Version
231
+ version: 1.3.6
169
232
  type: :development
170
233
  prerelease: false
171
- version_requirements: *id014
172
- - !ruby/object:Gem::Dependency
234
+ version_requirements: !ruby/object:Gem::Requirement
235
+ none: false
236
+ requirements:
237
+ - - ~>
238
+ - !ruby/object:Gem::Version
239
+ version: 1.3.6
240
+ - !ruby/object:Gem::Dependency
173
241
  name: rdiscount
174
- requirement: &id015 !ruby/object:Gem::Requirement
242
+ requirement: !ruby/object:Gem::Requirement
175
243
  none: false
176
- requirements:
244
+ requirements:
177
245
  - - ~>
178
- - !ruby/object:Gem::Version
179
- version: 1.6.8
246
+ - !ruby/object:Gem::Version
247
+ version: 2.0.7
180
248
  type: :development
181
249
  prerelease: false
182
- version_requirements: *id015
183
- - !ruby/object:Gem::Dependency
250
+ version_requirements: !ruby/object:Gem::Requirement
251
+ none: false
252
+ requirements:
253
+ - - ~>
254
+ - !ruby/object:Gem::Version
255
+ version: 2.0.7
256
+ - !ruby/object:Gem::Dependency
184
257
  name: RedCloth
185
- requirement: &id016 !ruby/object:Gem::Requirement
258
+ requirement: !ruby/object:Gem::Requirement
186
259
  none: false
187
- requirements:
260
+ requirements:
188
261
  - - ~>
189
- - !ruby/object:Gem::Version
190
- version: 4.2.7
262
+ - !ruby/object:Gem::Version
263
+ version: 4.2.9
191
264
  type: :development
192
265
  prerelease: false
193
- version_requirements: *id016
194
- - !ruby/object:Gem::Dependency
266
+ version_requirements: !ruby/object:Gem::Requirement
267
+ none: false
268
+ requirements:
269
+ - - ~>
270
+ - !ruby/object:Gem::Version
271
+ version: 4.2.9
272
+ - !ruby/object:Gem::Dependency
195
273
  name: erubis
196
- requirement: &id017 !ruby/object:Gem::Requirement
274
+ requirement: !ruby/object:Gem::Requirement
197
275
  none: false
198
- requirements:
276
+ requirements:
199
277
  - - ~>
200
- - !ruby/object:Gem::Version
278
+ - !ruby/object:Gem::Version
201
279
  version: 2.7.0
202
280
  type: :development
203
281
  prerelease: false
204
- version_requirements: *id017
205
- - !ruby/object:Gem::Dependency
282
+ version_requirements: !ruby/object:Gem::Requirement
283
+ none: false
284
+ requirements:
285
+ - - ~>
286
+ - !ruby/object:Gem::Version
287
+ version: 2.7.0
288
+ - !ruby/object:Gem::Dependency
206
289
  name: less
207
- requirement: &id018 !ruby/object:Gem::Requirement
290
+ requirement: !ruby/object:Gem::Requirement
208
291
  none: false
209
- requirements:
292
+ requirements:
210
293
  - - ~>
211
- - !ruby/object:Gem::Version
212
- version: 1.2.21
294
+ - !ruby/object:Gem::Version
295
+ version: 2.2.2
213
296
  type: :development
214
297
  prerelease: false
215
- version_requirements: *id018
216
- - !ruby/object:Gem::Dependency
298
+ version_requirements: !ruby/object:Gem::Requirement
299
+ none: false
300
+ requirements:
301
+ - - ~>
302
+ - !ruby/object:Gem::Version
303
+ version: 2.2.2
304
+ - !ruby/object:Gem::Dependency
217
305
  name: radius
218
- requirement: &id019 !ruby/object:Gem::Requirement
306
+ requirement: !ruby/object:Gem::Requirement
219
307
  none: false
220
- requirements:
308
+ requirements:
221
309
  - - ~>
222
- - !ruby/object:Gem::Version
223
- version: 0.6.1
310
+ - !ruby/object:Gem::Version
311
+ version: 0.7.3
224
312
  type: :development
225
313
  prerelease: false
226
- version_requirements: *id019
227
- - !ruby/object:Gem::Dependency
314
+ version_requirements: !ruby/object:Gem::Requirement
315
+ none: false
316
+ requirements:
317
+ - - ~>
318
+ - !ruby/object:Gem::Version
319
+ version: 0.7.3
320
+ - !ruby/object:Gem::Dependency
228
321
  name: coffee-script
229
- requirement: &id020 !ruby/object:Gem::Requirement
322
+ requirement: !ruby/object:Gem::Requirement
230
323
  none: false
231
- requirements:
324
+ requirements:
232
325
  - - ~>
233
- - !ruby/object:Gem::Version
326
+ - !ruby/object:Gem::Version
234
327
  version: 2.2.0
235
328
  type: :development
236
329
  prerelease: false
237
- version_requirements: *id020
238
- description: Serve is a small Rack-based web server that makes it easy to serve ERB or HAML from any directory. Serve is an ideal tool for building HTML prototypes of Rails applications. Serve can also handle SASS, Textile, and Markdown if the appropriate gems are installed.
330
+ version_requirements: !ruby/object:Gem::Requirement
331
+ none: false
332
+ requirements:
333
+ - - ~>
334
+ - !ruby/object:Gem::Version
335
+ version: 2.2.0
336
+ description: Serve is a small Rack-based web server that makes it easy to serve ERB
337
+ or HAML from any directory. Serve is an ideal tool for building HTML prototypes
338
+ of Rails applications. Serve can also handle SASS, Textile, and Markdown if the
339
+ appropriate gems are installed.
239
340
  email: me@johnwlong.com
240
- executables:
341
+ executables:
241
342
  - serve
242
343
  extensions: []
243
-
244
- extra_rdoc_files:
344
+ extra_rdoc_files:
245
345
  - LICENSE
246
346
  - README.rdoc
247
- files:
347
+ files:
248
348
  - CHANGELOG.rdoc
249
349
  - Gemfile
250
350
  - Gemfile.lock
@@ -261,6 +361,7 @@ files:
261
361
  - lib/serve/bootstrap/config.ru
262
362
  - lib/serve/bootstrap/gitignore
263
363
  - lib/serve/export.rb
364
+ - lib/serve/handlers/coffee_handler.rb
264
365
  - lib/serve/handlers/dynamic_handler.rb
265
366
  - lib/serve/handlers/email_handler.rb
266
367
  - lib/serve/handlers/file_type_handler.rb
@@ -270,6 +371,7 @@ files:
270
371
  - lib/serve/javascripts.rb
271
372
  - lib/serve/out.rb
272
373
  - lib/serve/path.rb
374
+ - lib/serve/pipeline.rb
273
375
  - lib/serve/project.rb
274
376
  - lib/serve/rack.rb
275
377
  - lib/serve/router.rb
@@ -292,9 +394,17 @@ files:
292
394
  - lib/serve/version.rb
293
395
  - lib/serve/view_helpers.rb
294
396
  - spec/application_spec.rb
397
+ - spec/fixtures/directory/_layout.erb
398
+ - spec/fixtures/directory/coffee.coffee
295
399
  - spec/fixtures/directory/index.html
400
+ - spec/fixtures/directory/markdown.html.markdown
401
+ - spec/fixtures/directory/markdown.markdown
402
+ - spec/fixtures/directory/markdown_erb.markdown.erb
403
+ - spec/fixtures/directory/subdirectory/test.erb
404
+ - spec/fixtures/file.erb
296
405
  - spec/fixtures/hello.html
297
406
  - spec/fixtures/stylesheets/application.sass
407
+ - spec/pipeline_spec.rb
298
408
  - spec/project_spec.rb
299
409
  - spec/router_spec.rb
300
410
  - spec/spec_helper.rb
@@ -303,36 +413,33 @@ files:
303
413
  - spec/views/hello.html.erb
304
414
  - spec/views/index.redirect
305
415
  - spec/views/view_helpers.rb
306
- has_rdoc: true
307
416
  homepage: http://get-serve.com
308
- licenses:
417
+ licenses:
309
418
  - MIT
310
419
  post_install_message:
311
420
  rdoc_options: []
312
-
313
- require_paths:
421
+ require_paths:
314
422
  - lib
315
- required_ruby_version: !ruby/object:Gem::Requirement
423
+ required_ruby_version: !ruby/object:Gem::Requirement
316
424
  none: false
317
- requirements:
318
- - - ">="
319
- - !ruby/object:Gem::Version
320
- hash: -3258795319669960495
321
- segments:
425
+ requirements:
426
+ - - ! '>='
427
+ - !ruby/object:Gem::Version
428
+ version: '0'
429
+ segments:
322
430
  - 0
323
- version: "0"
324
- required_rubygems_version: !ruby/object:Gem::Requirement
431
+ hash: 3327137791862807691
432
+ required_rubygems_version: !ruby/object:Gem::Requirement
325
433
  none: false
326
- requirements:
327
- - - ">="
328
- - !ruby/object:Gem::Version
329
- version: "0"
434
+ requirements:
435
+ - - ! '>='
436
+ - !ruby/object:Gem::Version
437
+ version: '0'
330
438
  requirements: []
331
-
332
439
  rubyforge_project:
333
- rubygems_version: 1.6.2
440
+ rubygems_version: 1.8.24
334
441
  signing_key:
335
442
  specification_version: 3
336
- summary: Serve is a small web server that makes it easy to serve ERB or HAML from any directory.
443
+ summary: Serve is a small web server that makes it easy to serve ERB or HAML from
444
+ any directory.
337
445
  test_files: []
338
-