strong_routes 0.9.3 → 0.9.4

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: 71eb6db636e7c67d3e3ca4df52256cd0ec42146d
4
- data.tar.gz: fec00ffa91534d046242fa1be5560c91812c6744
3
+ metadata.gz: b116b59eb73f3c72bef5bc449e556dd5c1bfe649
4
+ data.tar.gz: f1af77b8e1dd91216dae5aedf2948603f205faf0
5
5
  SHA512:
6
- metadata.gz: 878b70625b77b8c3722279681c2d7eb3cd51b367a06a29de18d278e067405a968af9ba91244f5140be6e71180e73cd29aa19f4a2edb2115acc713b398fe5e78d
7
- data.tar.gz: aa4523e8ec53db12771933cd7bb2e83542c52cfa91bda5bea3ef61438ab343d0eb0a99d43b338f75269c67e022d2f9b46ac7ec24024a5cd5e467e3b0c1286c91
6
+ metadata.gz: c2f08941062497b8a02c2f91f42f989dfff8f53e5ccb5d30a77fea49c4debb57873987a13df09f65bad5f50816c43b68e40e7937766e0f86236a5965e5ecb54d
7
+ data.tar.gz: 9106b104c24facc56b9d527da3ce70e03e8a500e9fbc7b756d24e64b1d933d2a7c51ae4cd4ddbee26372f5649b2ac31b3b4fe0c106307fe9de00f24bcd6e1e4f
@@ -2,7 +2,7 @@ module StrongRoutes
2
2
  class Allow
3
3
  def initialize(app, options = {})
4
4
  @app = app
5
- @options = ::StrongRoutes.config.merge(options)
5
+ @options = options
6
6
  end
7
7
 
8
8
  def call(env)
@@ -13,7 +13,7 @@ module StrongRoutes
13
13
  if allowed?(request)
14
14
  @app.call(env)
15
15
  else
16
- [ 404, { "Content-Type" => "text/html", "Content-Length" => @options.message.length }, [ @options.message ] ]
16
+ [ 404, { "Content-Type" => "text/html", "Content-Length" => config.message.length }, [ config.message ] ]
17
17
  end
18
18
  end
19
19
 
@@ -21,7 +21,7 @@ module StrongRoutes
21
21
 
22
22
  def allowed_routes
23
23
  @allowed_routes ||= begin
24
- routes = [ @options[:allowed_routes] ]
24
+ routes = [ config.allowed_routes ]
25
25
  routes.flatten!
26
26
  routes.compact!
27
27
  routes.uniq!
@@ -33,8 +33,12 @@ module StrongRoutes
33
33
  route_matchers.any? { |route_matcher| route_matcher =~ request.path_info }
34
34
  end
35
35
 
36
+ def config
37
+ @config ||= StrongRoutes.config.merge(@options)
38
+ end
39
+
36
40
  def enabled?
37
- @options[:enabled]
41
+ config.enabled?
38
42
  end
39
43
 
40
44
  def route_matchers
@@ -1,3 +1,3 @@
1
1
  module StrongRoutes
2
- VERSION = "0.9.3"
2
+ VERSION = "0.9.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strong_routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Hutchison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-17 00:00:00.000000000 Z
11
+ date: 2014-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack