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 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
- result = @resources["/index.html"]
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
@@ -1,3 +1,3 @@
1
1
  module Golf
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: golf
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.3
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
@@ -1,7 +0,0 @@
1
- $.golf.controller = [
2
- { route: ".*",
3
- action: function(container, params) {
4
- container.empty().append(new Component.HelloWorld());
5
- }
6
- }
7
- ];