bezel-app 0.0.18 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bezel-app.gemspec +1 -1
- data/lib/static_assets.rb +14 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32b18146e9cff0108404bc2284c5bc8bad61d6b4
|
4
|
+
data.tar.gz: 0a7b330b08d9236c68118542842ff28a4dc7bf01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1aa894f80f75550ca3e6b57cd704c73da2bb393ba91253501dde1c8f81e1bb323fc226dd7affa61b8c684fe7388b6d87be0fc1e1f0281cf855dd18032438da3
|
7
|
+
data.tar.gz: 91388ddbeacfdefebd21cd4fb96396e02893ebc0fec571e1f507644a77e8e981193bf4808937a87725a5f3e201ad53691099497588e73ed44f00ef11f350010d
|
data/bezel-app.gemspec
CHANGED
data/lib/static_assets.rb
CHANGED
@@ -6,17 +6,21 @@ module Bezel
|
|
6
6
|
|
7
7
|
def call(env)
|
8
8
|
file_path = "." + env['PATH_INFO']
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
if file_path =~ (/^app\/assets/)
|
10
|
+
res = Rack::Response.new
|
11
|
+
extension = /\.(\w*$)/.match(file_path)[1]
|
12
|
+
begin
|
13
|
+
res['Content-Type'] = set_content_type(extension)
|
14
|
+
content = File.read(file_path)
|
15
|
+
res.write(content)
|
16
|
+
rescue
|
17
|
+
res.status = 404
|
18
|
+
end
|
18
19
|
|
19
|
-
|
20
|
+
res.finish
|
21
|
+
else
|
22
|
+
@app.call(env)
|
23
|
+
end
|
20
24
|
end
|
21
25
|
end
|
22
26
|
|