airbrake 9.5.3 → 9.5.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
  SHA256:
3
- metadata.gz: dc5653068c80669e6ed4a43ffc993715337e59ae4b13169fbc9cf5b82e438804
4
- data.tar.gz: 272a62d259ac08b1cbd66db11b84fbbae272fb12aea9a6edefd6e3d9d26d18db
3
+ metadata.gz: 1674eebe809e2624774c0d3166fe5e214db9f947a9b41cfcdf4d510268e77993
4
+ data.tar.gz: c902febfb24d2a8147324b8cb9d225ba41529ee89b97ace68be9c5a529885578
5
5
  SHA512:
6
- metadata.gz: ae7993740f12db8a622f4264157bf71cc9e84e7f2674a1d73e61202217823ea478f3f512cdc9eaeafb828517d5101417be65869c51d1a27624bc22ae9724cbc6
7
- data.tar.gz: 2bc63b888f983a7622a1e63caa4d6cc76597aacbfcb28dcc79484da038ee2cafc91773edb40a3061b771f091579a5b3f701b5c456f2d7aba35ac0b3af76d03e7
6
+ metadata.gz: ccc91fb99278364f2539ed0a09bc8e60aef3780c651f92b65f05108b320d464f6627daf18c3c838def9d7ac6203fd46c84f333d6d905b0959c9b93aae509a2ff
7
+ data.tar.gz: 151914bb3405cdd4c094a664ef81eb214fe269cacd3af17f8922e2b6bfb79b375f63dcdafe7df06c05aad7a69a1f58358196c3ade5e2fa6f5c43f84347ebab37
@@ -26,7 +26,7 @@ module Airbrake
26
26
 
27
27
  def rails_route(request)
28
28
  return unless (route = Airbrake::Rails::App.recognize_route(request))
29
- route.path.spec.to_s
29
+ route.path
30
30
  end
31
31
 
32
32
  def sinatra_route(request)
@@ -18,20 +18,12 @@ module Airbrake
18
18
  )
19
19
  return unless route
20
20
 
21
- routes[find_route_name(route)] = {
21
+ routes[route.path] = {
22
22
  method: event.method,
23
23
  response_type: event.response_type,
24
24
  groups: {}
25
25
  }
26
26
  end
27
-
28
- def find_route_name(route)
29
- if route.app.respond_to?(:app) && route.app.app.respond_to?(:engine_name)
30
- "#{route.app.app.engine_name}##{route.path.spec}"
31
- else
32
- route.path.spec.to_s
33
- end
34
- end
35
27
  end
36
28
  end
37
29
  end
@@ -5,8 +5,19 @@ module Airbrake
5
5
  # @since v9.0.3
6
6
  # @api private
7
7
  class App
8
+ Route = Struct.new(:path)
9
+
10
+ # @param [] request
11
+ # @return [Airbrake::Rails::App::Route, nil]
8
12
  def self.recognize_route(request)
9
13
  ::Rails.application.routes.router.recognize(request) do |route, _params|
14
+ path =
15
+ if route.app.respond_to?(:app) && route.app.app.respond_to?(:engine_name)
16
+ "#{route.app.app.engine_name}##{route.path.spec}"
17
+ else
18
+ route.path.spec.to_s
19
+ end
20
+
10
21
  # Rails can recognize multiple routes for the given request. For
11
22
  # example, if we visit /users/2/edit, then Rails sees these routes:
12
23
  # * "/users/:id/edit(.:format)"
@@ -14,8 +25,10 @@ module Airbrake
14
25
  #
15
26
  # We return the first route as, what it seems, the most optimal
16
27
  # approach.
17
- return route
28
+ return Route.new(path)
18
29
  end
30
+
31
+ nil
19
32
  end
20
33
  end
21
34
  end
@@ -1,5 +1,5 @@
1
1
  # We use Semantic Versioning v2.0.0
2
2
  # More information: http://semver.org/
3
3
  module Airbrake
4
- AIRBRAKE_VERSION = '9.5.3'.freeze
4
+ AIRBRAKE_VERSION = '9.5.4'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.5.3
4
+ version: 9.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbrake Technologies, Inc.