routes_coverage 0.3.0 → 0.3.1

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: 026e5816e111dad871c8ec89b6f19de4ccde34dc
4
- data.tar.gz: 42e3f410f9a0c1475e9e8e0b4be008787b7b8339
3
+ metadata.gz: 6aad5a94925c3cc12b598d2782a569d204ddba0b
4
+ data.tar.gz: e04b8251b3ea90b14d771fd08efb1f553ce34b39
5
5
  SHA512:
6
- metadata.gz: 602ab554a4a5a164ecaa4b73ae4bcf5a801af5c6f47b05c833b274c5f4819e48f9bb6ed5e58de75725ca78f0a2cd1237c186f578108b41230726c45837bbb9d1
7
- data.tar.gz: 57ff9b05890686d40b6f759e1663c9c72bd50cc8fa1537a58048879d8bfa87c7b18cd08f35518e26e06bbd70e4283ce064680585e9f84b45de72f351fee21d93
6
+ metadata.gz: 88acd61825c9a1de178407cb2bdab1097667310d772a93a4074b3ae078cd9c6f6fa9d85872b90d9e3c56e05db3e55a0e9c060e498ad053673394ac5184b82f14
7
+ data.tar.gz: 181d4b8ae63084ed5c4238c09b5ab373e100854ffc3254365e7e94329ca436b41a59995e8574cefc99a37165a38fb063a96360b23fbba4f4b3cd7e6a24c9a21f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- routes_coverage (0.3.0)
4
+ routes_coverage (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- routes_coverage (0.3.0)
4
+ routes_coverage (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- routes_coverage (0.3.0)
4
+ routes_coverage (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- routes_coverage (0.3.0)
4
+ routes_coverage (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- routes_coverage (0.3.0)
4
+ routes_coverage (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- routes_coverage (0.3.0)
4
+ routes_coverage (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -12,7 +12,7 @@ module RoutesCoverage
12
12
  super()
13
13
  end
14
14
 
15
- def no_routes
15
+ def no_routes _routes_from_rails5=nil
16
16
  @buffer << "\tNone"
17
17
  end
18
18
 
@@ -7,9 +7,24 @@ module RoutesCoverage
7
7
  def call env
8
8
  req = ::Rails.application.routes.request_class.new env
9
9
  ::Rails.application.routes.router.recognize(req) do |route|
10
+ dispatcher = route.app
11
+ if dispatcher.respond_to?(:dispatcher?)
12
+ dispatcher = nil unless dispatcher.matches?(req) && dispatcher.dispatcher?
13
+ else # rails < 4.2
14
+ dispatcher = route.app
15
+ while dispatcher.is_a?(ActionDispatch::Routing::Mapper::Constraints) do
16
+ if dispatcher.matches?(env)
17
+ dispatcher = dispatcher.app
18
+ else
19
+ dispatcher = nil
20
+ end
21
+ end
22
+ end
23
+ next unless dispatcher
24
+
10
25
  RoutesCoverage._touch_route(route)
11
26
  # there may be multiple matching routes - we should match only first
12
- return @app.call(env)
27
+ break
13
28
  end
14
29
  #TODO: detect 404s? and maybe other route errors?
15
30
  @app.call(env)
@@ -1,3 +1,3 @@
1
1
  module RoutesCoverage
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: routes_coverage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Fedoseyev