golf 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/golf/rack.rb +12 -1
- data/lib/golf/version.rb +1 -1
- metadata +1 -2
- data/resources/controller.js +0 -7
data/lib/golf/rack.rb
CHANGED
@@ -11,10 +11,21 @@ module Golf
|
|
11
11
|
|
12
12
|
def call(env)
|
13
13
|
code = "200"
|
14
|
+
|
15
|
+
if File.exists?(env["PATH_INFO"]) and env["PATH_INFO"] != "/"
|
16
|
+
mime = MIME_TYPES[".#{env["PATH_INFO"].split('.').last}"]
|
17
|
+
result = File.read(env["PATH_INFO"])
|
18
|
+
return [code, { 'Content-Type' => mime, 'Content-Length' => result.length.to_s}, [result]]
|
19
|
+
end
|
20
|
+
|
14
21
|
case env["PATH_INFO"]
|
15
22
|
when "/"
|
16
23
|
mime = MIME_TYPES[".html"]
|
17
|
-
|
24
|
+
if File.exists?('index.html')
|
25
|
+
result = File.read('index.html')
|
26
|
+
else
|
27
|
+
result = @resources["/index.html"]
|
28
|
+
end
|
18
29
|
when "/components.js"
|
19
30
|
mime = MIME_TYPES[".js"]
|
20
31
|
result = @compiler.generate_componentsjs
|
data/lib/golf/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: golf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Micha Niskin, Alan Dipert, Julio Capote
|
@@ -68,7 +68,6 @@ files:
|
|
68
68
|
- lib/golf/rack.rb
|
69
69
|
- lib/golf/version.rb
|
70
70
|
- resources/app_error.html
|
71
|
-
- resources/controller.js
|
72
71
|
- resources/index.html
|
73
72
|
- resources/jquery.address.js
|
74
73
|
- resources/jquery.golf.js
|