coffeeshop 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/bin/coffeeshop +13 -12
  2. data/lib/coffeeshop/version.rb +1 -1
  3. metadata +7 -7
data/bin/coffeeshop CHANGED
@@ -10,21 +10,22 @@ configure do
10
10
  set :run, true
11
11
  end
12
12
 
13
- not_found do
14
- path = settings.root + env["PATH_INFO"]
13
+ get %r{/.+.js$} do
14
+ path = settings.root + request.path_info
15
15
  coffee_path = path.sub( /\.js$/, ".coffee" )
16
-
17
- if path =~ /\.js$/ && File.exists?( coffee_path )
16
+ if File.exists?( coffee_path )
18
17
  content_type "text/javascript"
19
18
  Coffeeshop.to_js( coffee_path )
20
19
  else
21
- if path =~ /\/$/
22
- index_path = "#{path}index.html"
23
- else
24
- index_path = "#{path}/index.html"
25
- end
26
- if File.exists?( index_path )
27
- File.read( index_path )
28
- end
20
+ raise Sinatra::NotFound
21
+ end
22
+ end
23
+
24
+ not_found do
25
+ index_path = settings.root + env["PATH_INFO"]
26
+ index_path += "/" unless index_path =~ /\/$/
27
+ index_path = "#{index_path}/index.html"
28
+ if File.exists?( index_path )
29
+ File.read( index_path )
29
30
  end
30
31
  end
@@ -1,3 +1,3 @@
1
1
  module Coffeeshop
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coffeeshop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &70208448224400 !ruby/object:Gem::Requirement
16
+ requirement: &70234410998780 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70208448224400
24
+ version_requirements: *70234410998780
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: coffee-script
27
- requirement: &70208446792420 !ruby/object:Gem::Requirement
27
+ requirement: &70234410998360 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70208446792420
35
+ version_requirements: *70234410998360
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: redis
38
- requirement: &70208446789400 !ruby/object:Gem::Requirement
38
+ requirement: &70234410997940 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70208446789400
46
+ version_requirements: *70234410997940
47
47
  description: coffeeshop is a quick and dirty Sinatra app that serves up any CoffeeScript
48
48
  in a directory as JavaScript. It uses Redis for basic caching because that's how
49
49
  I roll.