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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1674eebe809e2624774c0d3166fe5e214db9f947a9b41cfcdf4d510268e77993
|
4
|
+
data.tar.gz: c902febfb24d2a8147324b8cb9d225ba41529ee89b97ace68be9c5a529885578
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccc91fb99278364f2539ed0a09bc8e60aef3780c651f92b65f05108b320d464f6627daf18c3c838def9d7ac6203fd46c84f333d6d905b0959c9b93aae509a2ff
|
7
|
+
data.tar.gz: 151914bb3405cdd4c094a664ef81eb214fe269cacd3af17f8922e2b6bfb79b375f63dcdafe7df06c05aad7a69a1f58358196c3ade5e2fa6f5c43f84347ebab37
|
@@ -18,20 +18,12 @@ module Airbrake
|
|
18
18
|
)
|
19
19
|
return unless route
|
20
20
|
|
21
|
-
routes[
|
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
|
data/lib/airbrake/rails/app.rb
CHANGED
@@ -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
|
28
|
+
return Route.new(path)
|
18
29
|
end
|
30
|
+
|
31
|
+
nil
|
19
32
|
end
|
20
33
|
end
|
21
34
|
end
|
data/lib/airbrake/version.rb
CHANGED