mascot-server 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/config.ru +1 -1
  3. data/lib/mascot-server.rb +2 -9
  4. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb409db2b5ad078818185220ddf2688f8e2b7978
4
- data.tar.gz: d5a247ad13dbb53312eddb92d67e6b8165481498
3
+ metadata.gz: 726e09ddb5480464e49aa6c95aac383d82a2cb17
4
+ data.tar.gz: 6aaba5da158d2b5b3c6a8a9e8646c84bff28f7c4
5
5
  SHA512:
6
- metadata.gz: 43307fe02e8b342084f0c1b9410f6997f0b4b3f2ac7efdf5bc1348273cea5be42e98e7592f1c6870746cd6bb78ec56e919bed9a250ef2031f7389758702b690e
7
- data.tar.gz: 8a96f202d73de8e10b3841d83bd3abebf4fcbb86f4f54906587f52ee97d0a575364599966ea0172a9285cd4039e7bf69abbe75da414ca6f8816c16e54c77e043
6
+ metadata.gz: 9b7a8807ac3f5e41d96615f5ecd7ec898c6c31499aab97e56798766384f0d823c2b545a3e8fbafcf02d569498ddf38a9cd5e22f61e61c9aee78d588aaa7dc472
7
+ data.tar.gz: adc677b033b66931f14a3706ac082975c2352e157a9a2a7bedb84fcbce76eb7027d54c59bd97fcfe4bc714b635d2c8e365ed400b34955a7f65a821c194363e99
data/config.ru CHANGED
@@ -1,4 +1,4 @@
1
1
  require "mascot-server"
2
2
 
3
- sitemap = Mascot::Sitemap.new(file_path: "spec/pages")
3
+ sitemap = Mascot::Sitemap.new(root: "spec/pages")
4
4
  run Mascot::Server.new(sitemap: sitemap)
data/lib/mascot-server.rb CHANGED
@@ -14,7 +14,7 @@ module Mascot
14
14
 
15
15
  private
16
16
  def engine
17
- Tilt[@resource.file_path]
17
+ Tilt[@resource.asset.path]
18
18
  end
19
19
  end
20
20
 
@@ -29,7 +29,7 @@ module Mascot
29
29
 
30
30
  def call(env)
31
31
  req = Rack::Request.new(env)
32
- resource = @sitemap.find_by_request_path normalize_path(req.path)
32
+ resource = @sitemap.get req.path
33
33
 
34
34
  if resource
35
35
  [ 200, {"Content-Type" => resource.mime_type.to_s}, [TiltRenderer.new(resource).render] ]
@@ -37,12 +37,5 @@ module Mascot
37
37
  [ 404, {"Content-Type" => "text/plain"}, ["Not Found"]]
38
38
  end
39
39
  end
40
-
41
- private
42
- # If we mount this middleware in a path other than root, we need to configure it
43
- # so that it correctly maps the request path to the content path.
44
- def normalize_path(request_path)
45
- ROOT_PATH.join(Pathname.new(request_path).relative_path_from(@relative_to)).to_s
46
- end
47
40
  end
48
41
  end
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.5
4
+ version: 0.1.6
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-24 00:00:00.000000000 Z
11
+ date: 2016-07-28 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.5
61
+ version: 0.1.6
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.5
68
+ version: 0.1.6
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: tilt
71
71
  requirement: !ruby/object:Gem::Requirement