airbrake 9.4.1 → 9.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/airbrake/rails/app.rb +19 -9
- data/lib/airbrake/rails/event.rb +6 -0
- data/lib/airbrake/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b1a464954b87f553c38390071a1303fdceb5685
|
4
|
+
data.tar.gz: '0783aa316473e43d0f71a9962e0f8fac89cc1092'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b10df6a1026885ad9770e6b9e594575356cd0c2d0dbd15aa775ab0ac67c6a079749bf2dbcacce5405ba5cc341481b0ef84a172e6654a3db893476b2326466ee
|
7
|
+
data.tar.gz: 5426af26c8efde7f68b519e3ad7b151291b897fa8d6503c408b0e6c8bcca699554e80e7319ee7afb908a3fd2fd1390d2d59f31f78e1dfe04043d8eb8a26633de
|
data/lib/airbrake/rails/app.rb
CHANGED
@@ -8,26 +8,36 @@ module Airbrake
|
|
8
8
|
Route = Struct.new(:path, :controller, :action)
|
9
9
|
|
10
10
|
def routes
|
11
|
-
@routes ||=
|
12
|
-
|
13
|
-
route.path.spec.to_s,
|
14
|
-
route.defaults[:controller],
|
15
|
-
route.defaults[:action]
|
16
|
-
)
|
11
|
+
@routes ||= app_routes.merge(engine_routes).flat_map do |(engine_name, routes)|
|
12
|
+
routes.map { |rails_route| build_route(engine_name, rails_route) }
|
17
13
|
end
|
18
14
|
end
|
19
15
|
|
20
16
|
private
|
21
17
|
|
22
18
|
def app_routes
|
23
|
-
|
19
|
+
# Engine name is nil because this is default (non-engine) routes.
|
20
|
+
{ nil => ::Rails.application.routes.routes.routes }
|
24
21
|
end
|
25
22
|
|
26
23
|
def engine_routes
|
27
|
-
::Rails::Engine.subclasses.flat_map do |engine|
|
28
|
-
engine.routes.routes.routes
|
24
|
+
::Rails::Engine.subclasses.flat_map.with_object({}) do |engine, hash|
|
25
|
+
next if (eng_routes = engine.routes.routes.routes).none?
|
26
|
+
|
27
|
+
hash[engine.engine_name] = eng_routes
|
29
28
|
end
|
30
29
|
end
|
30
|
+
|
31
|
+
def build_route(engine_name, rails_route)
|
32
|
+
engine_prefix = engine_name
|
33
|
+
engine_prefix += '#' if engine_prefix
|
34
|
+
|
35
|
+
Route.new(
|
36
|
+
"#{engine_prefix}#{rails_route.path.spec}",
|
37
|
+
rails_route.defaults[:controller],
|
38
|
+
rails_route.defaults[:action]
|
39
|
+
)
|
40
|
+
end
|
31
41
|
end
|
32
42
|
end
|
33
43
|
end
|
data/lib/airbrake/rails/event.rb
CHANGED
@@ -8,6 +8,8 @@ module Airbrake
|
|
8
8
|
# @see https://github.com/rails/rails/issues/8987
|
9
9
|
HTML_RESPONSE_WILDCARD = "*/*".freeze
|
10
10
|
|
11
|
+
include Airbrake::Loggable
|
12
|
+
|
11
13
|
def initialize(*args)
|
12
14
|
@event = ActiveSupport::Notifications::Event.new(*args)
|
13
15
|
end
|
@@ -64,6 +66,10 @@ module Airbrake
|
|
64
66
|
return status
|
65
67
|
end
|
66
68
|
|
69
|
+
logger.error do
|
70
|
+
"#{Airbrake::LOG_LABEL} unknown status code for: #{@event.payload}"
|
71
|
+
end
|
72
|
+
|
67
73
|
0
|
68
74
|
end
|
69
75
|
|
data/lib/airbrake/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.4.
|
4
|
+
version: 9.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airbrake Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: airbrake-ruby
|