wouter 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd4c35292f230db30dd6f3336fe819b5ef97c4cf48c10d6d6a607e9211ae85ed
4
- data.tar.gz: 5c6ac17162617bf2703ab60f4c7f507e96a793be402fe72bde97dea1621ed347
3
+ metadata.gz: 548efc09cff8742bc42c2a5eaaafe006b9803842efa91a87ad3ea8dfc91415b2
4
+ data.tar.gz: 7bda7d397f11eb9056f192881eb23904be7b54b72ea8feffc4ea840fa93a8606
5
5
  SHA512:
6
- metadata.gz: 2893cd88f2bc0ecd8d299ee03629ed6d2d57c6524ffeb6eb4b44985d085c70c30ae2551d61792469f291a5f7c377a61a7aa5641c24e5f915dd1879bfacae4108
7
- data.tar.gz: f42f3985c80a5606f33726d66ced3c55aeb5f4a0378cea8f12d85047c849540191befa1e0ecfd5bb522166721708209f8137765681670b262e9a94c9a406a3cf
6
+ metadata.gz: a8ee9e6284d3f921a602576eba62059354ce1294892d5d16d687f029955a478d82e26f0a3f6a61fdd56095fbc1ea59401f7f16e06734c07933c6352042dab006
7
+ data.tar.gz: 8f252746af42cd528ab797664c26a8e317e5368584e460d351b544f6377eb6017b1d020029e01ac333786003b06b7edddf7f9c6415e1e42f0b7f3b765f181d34
data/README.md CHANGED
@@ -26,7 +26,7 @@ end
26
26
  run Routes.build
27
27
  ```
28
28
 
29
- Intances of `Wouter::Endpoint` are Rack applications. Instances of `Wouter` are Rack applications. `Wouter` builds routes to dispatch requests to `Wouter::Endpoint` instances.
29
+ `Wouter` builds routes to dispatch requests to `Wouter::Endpoint` instances.
30
30
 
31
31
  An example application can be viewed [here](./test/test_app.rb).
32
32
 
@@ -9,14 +9,14 @@ class Wouter::Endpoint
9
9
 
10
10
  attr_reader :req, :res, :config
11
11
 
12
- def initialize(req, res, config = {})
12
+ def initialize(req, res)
13
13
  @req = req
14
14
  @res = res
15
- @config = config
15
+ @config = req.env['wouter']
16
16
  end
17
17
 
18
18
  def self.call(env, config = {})
19
- endpoint = new(Rack::Request.new(env), Rack::Response.new, config)
19
+ endpoint = new(Rack::Request.new(env), Rack::Response.new)
20
20
  response = endpoint.respond
21
21
 
22
22
  return response.finish if response.is_a?(Rack::Response)
@@ -11,6 +11,7 @@ class Wouter::Wrapper
11
11
  end
12
12
 
13
13
  def call(env)
14
+ env['wouter'] = @config
14
15
  request = Rack::Request.new(env)
15
16
  route = find_route(request)
16
17
 
@@ -18,7 +19,7 @@ class Wouter::Wrapper
18
19
  route.params(request).each do |name, value|
19
20
  request.update_param(name, value)
20
21
  end
21
- route.klass.call(request.env, @config)
22
+ route.klass.call(request.env)
22
23
  else
23
24
  Wouter::Util.not_found
24
25
  end
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'wouter'
5
5
  s.platform = Gem::Platform::RUBY
6
- s.version = '0.0.9'
6
+ s.version = '0.0.10'
7
7
  s.summary = 'Rack web framework.'
8
8
  s.description = 'Wouter is a modular web framework built on top of Rack.'
9
9
  s.authors = ['Robert Peterson']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wouter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Peterson