mascot-server 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mascot-server.rb +4 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b16994025a9d507d16060b3baa89d3f816aad61e
|
4
|
+
data.tar.gz: 3564872476d4df5eeafcdcf9a78bda0cad3f1037
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fceeb1c7725234c52322cb2dd94b49bddb72ad60670ec9f2a0cdcc2b9afa45c231dc5c0de650d2ab7430fadacbd634def01b63e5e3acf0721951e4bd0263d1d0
|
7
|
+
data.tar.gz: df68e14a45c7b4f47654db5769e8650105eb7595f4a9481e4e7b7bfe33d982b0623d1a883866cd6e432bab81db5c597ac18857632cd2c23135a5a19dd38ef69b
|
data/lib/mascot-server.rb
CHANGED
@@ -8,7 +8,7 @@ module Mascot
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def render
|
11
|
-
template = engine.new {
|
11
|
+
template = engine.new { @resource.body }
|
12
12
|
template.render(Object.new, {current_page: @resource})
|
13
13
|
end
|
14
14
|
|
@@ -29,7 +29,9 @@ module Mascot
|
|
29
29
|
|
30
30
|
def call(env)
|
31
31
|
req = Rack::Request.new(env)
|
32
|
-
|
32
|
+
resource = @sitemap.find_by_request_path normalize_path(req.path)
|
33
|
+
|
34
|
+
if resource
|
33
35
|
[ 200, {"Content-Type" => resource.mime_type.to_s}, [TiltRenderer.new(resource).render] ]
|
34
36
|
else
|
35
37
|
[ 404, {"Content-Type" => "text/plain"}, ["Not Found"]]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mascot-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Gessler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.1.
|
61
|
+
version: 0.1.4
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.1.
|
68
|
+
version: 0.1.4
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: tilt
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|