rack-multiplexer 0.0.5 → 0.0.6

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
  SHA1:
3
- metadata.gz: 56192c72de737b0bf6d3f134b3de57774be7613e
4
- data.tar.gz: d27bf614ecef2456e7f2e3970e1d7b3a7190efde
3
+ metadata.gz: e7c8ab11fc06dc54a32046d1f2e609f282a223ab
4
+ data.tar.gz: 834508a68b91274b24d72356caa70960a62c4d51
5
5
  SHA512:
6
- metadata.gz: accd2f8899fb5d0cd0921c727980eeb6f4f2eca86f9865c830b613f08848bb9a4ca0afe268243a43ff5083cad64e17c5e89700e1bb710ed58432361e40e5cb9a
7
- data.tar.gz: f382488b74aaba47a00b802ed3ef4c072f6424b23ae551b127cf2f357c07efd231a825463883e7eee741e0ebde8b9486a5fee0f9c2c2f3366c97e0164d2b0d43
6
+ metadata.gz: 7a7406bf393f96a5a7c276e6489b141d2af984a9e0bf62a825f39d70f70ad27c33e5c3cf64d32b30e9cfba7a8e4ceb321bf2b747327dc2c1ccb1e1f0bc00c423
7
+ data.tar.gz: 7399eb6febb40685284406accdff52ad56ac7820e3977eb3c3112a14796206593153f505b485a5a7659db98d87b4235872f2c7cf5d397a2b5695d39347e19661
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Multiplexer
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -16,7 +16,7 @@ require "rack/request"
16
16
  #
17
17
  module Rack
18
18
  class Multiplexer
19
- def initialize(not_found_application = default_not_found_application, &block)
19
+ def initialize(not_found_application = nil, &block)
20
20
  @not_found_application = not_found_application
21
21
  instance_eval(&block) if block
22
22
  end
@@ -26,7 +26,7 @@ module Rack
26
26
  (
27
27
  routes[env["REQUEST_METHOD"]].find(path) ||
28
28
  routes["ANY"].find(path) ||
29
- @not_found_application
29
+ not_found_application
30
30
  ).call(env)
31
31
  end
32
32
 
@@ -58,8 +58,8 @@ module Rack
58
58
  @routes ||= Hash.new {|hash, key| hash[key] = Routes.new }
59
59
  end
60
60
 
61
- def default_not_found_application
62
- ->(env) {
61
+ def not_found_application
62
+ @not_found_application ||= ->(env) {
63
63
  [
64
64
  404,
65
65
  {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-multiplexer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-24 00:00:00.000000000 Z
11
+ date: 2014-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack