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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mascot-server.rb +4 -2
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1faef77e6ec58d5a5b638a3682b5a3d295433824
4
- data.tar.gz: 7b78aaf2080d03aa726c85fa89ca79801e563e69
3
+ metadata.gz: b16994025a9d507d16060b3baa89d3f816aad61e
4
+ data.tar.gz: 3564872476d4df5eeafcdcf9a78bda0cad3f1037
5
5
  SHA512:
6
- metadata.gz: 5847c38a6890e5ec9d262ca0d47d8c70590831bf04c7b2ad9f19088142518cab2168e05c0ccb17d8cf6bae9e53620d63f6bb2b380f57d6a51db09c3a7a066a5f
7
- data.tar.gz: fbbdeead490d46b6cb0a0bb73a024e3e85c519fc5a4dc35b060b2bbd83ef386808a00a558586b81ec2ea27ad64f4bb7260e7f32c954c3776c5b1fe09225d32a6
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 { |t| @resource.body }
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
- if resource = @sitemap.find_by_request_path(normalize_path(req.path))
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.3
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-23 00:00:00.000000000 Z
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.3
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.3
68
+ version: 0.1.4
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: tilt
71
71
  requirement: !ruby/object:Gem::Requirement