mascot-server 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d84d308b56e6f20990771ba0681078b332533ff
4
- data.tar.gz: 4f6031a79b988752050fd6e38c374e84ebfe76d7
3
+ metadata.gz: 68fc432996e8a8c208e9b68c6875079a37c6acb8
4
+ data.tar.gz: bf8fbb6b4a6f1af8d14b50fd0ef9a68e3b6f1b65
5
5
  SHA512:
6
- metadata.gz: 6f6b5059b5bf0125c7bd51206159709a072ba70cee3016fd6ec830a99be8176c135a308b9d93d076b71a73494e56f22755a4a23a7a7813544be2c2e5bcd1c922
7
- data.tar.gz: 91afc29fa0a418756543dded0df8935e7a76e01bd225445ca413571ab8dfda726314b7e444057f6869c620ff70fd4cc67ecdd8667033155f977d0e3e42ef0a75
6
+ metadata.gz: 27e1ed6dc516fad135417be7cbde8c32c97c17078c30e99aa485c97238fc1ed975d2960429e175e88ec1e86ee0f334130e75f7131ed4af0ce97eb3a30304cc39
7
+ data.tar.gz: cbb31468e0aaba0b7fbd11a6beeb57061f2e07da183cbc908c4ca38bf8428f894f6daec1a56b29fcbf55c961a58831c5d53f00848aa53d3fc86fcb43b023ad08
data/config.ru CHANGED
@@ -1,3 +1,4 @@
1
- require "mascot"
1
+ require "mascot-server"
2
2
 
3
- run Mascot::Server.glob("spec/pages/*")
3
+ sitemap = Mascot::Sitemap.new(file_path: "spec/pages")
4
+ run Mascot::Server.new(sitemap: sitemap)
@@ -23,7 +23,7 @@ module Mascot
23
23
  class Server
24
24
  ROOT_PATH = Pathname.new("/")
25
25
 
26
- def initialize(sitemap, relative_to: "/")
26
+ def initialize(sitemap: , relative_to: "/")
27
27
  @relative_to = Pathname.new(relative_to)
28
28
  @sitemap = sitemap
29
29
  end
@@ -31,7 +31,7 @@ module Mascot
31
31
  def call(env)
32
32
  req = Rack::Request.new(env)
33
33
  if resource = @sitemap.find_by_request_path(normalize_path(req.path))
34
- [ 200, {"Content-Type" => resource.content_type}, [TiltRenderer.new(resource).render] ]
34
+ [ 200, {"Content-Type" => resource.mime_type.to_s}, [TiltRenderer.new(resource).render] ]
35
35
  else
36
36
  [ 404, {"Content-Type" => "text/plain"}, ["Not Found"]]
37
37
  end
@@ -17,13 +17,10 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_development_dependency "bundler", "~> 1.11"
21
- spec.add_development_dependency "rake", "~> 10.0"
22
- spec.add_development_dependency "rspec", "~> 3.0"
23
20
  spec.add_development_dependency "haml", "~> 4.0"
24
21
  spec.add_development_dependency "rack-test"
25
22
  spec.add_development_dependency "rack"
26
23
 
27
24
  spec.add_runtime_dependency "mascot", spec.version
28
- spec.add_dependency "tilt"
25
+ spec.add_runtime_dependency "tilt"
29
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mascot-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
@@ -10,48 +10,6 @@ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2016-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.11'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.11'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '10.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '10.0'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '3.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '3.0'
55
13
  - !ruby/object:Gem::Dependency
56
14
  name: haml
57
15
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +58,14 @@ dependencies:
100
58
  requirements:
101
59
  - - '='
102
60
  - !ruby/object:Gem::Version
103
- version: 0.1.1
61
+ version: 0.1.2
104
62
  type: :runtime
105
63
  prerelease: false
106
64
  version_requirements: !ruby/object:Gem::Requirement
107
65
  requirements:
108
66
  - - '='
109
67
  - !ruby/object:Gem::Version
110
- version: 0.1.1
68
+ version: 0.1.2
111
69
  - !ruby/object:Gem::Dependency
112
70
  name: tilt
113
71
  requirement: !ruby/object:Gem::Requirement
@@ -151,8 +109,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
109
  version: '0'
152
110
  requirements: []
153
111
  rubyforge_project:
154
- rubygems_version: 2.2.3
112
+ rubygems_version: 2.5.1
155
113
  signing_key:
156
114
  specification_version: 4
157
115
  summary: Mascot rack app for stand-alone of embedded usage.
158
116
  test_files: []
117
+ has_rdoc: