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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5a13561811861e0707b33e7ea71324bba1eb04d
4
- data.tar.gz: 1a3ba50fbdbd48920dd9f26de0381a00e10babb1
3
+ metadata.gz: 9b1a464954b87f553c38390071a1303fdceb5685
4
+ data.tar.gz: '0783aa316473e43d0f71a9962e0f8fac89cc1092'
5
5
  SHA512:
6
- metadata.gz: 2463d6422b75772e915c11bf709430a32e3c9b077359d247aecb35f226bd5288a28017bdb1f9967504f5202b2066a2c4feba40d76f4152e959c665ff62f3d227
7
- data.tar.gz: 4a5b0dbbad8b83112e6b6d2c2e5257874e6ab14162af5d366986e3e58588233e31fcfb9253cafbabf1e0d9bb1d5f217add67a2cfc92bf9f0dcdaaa3fbfcd2060
6
+ metadata.gz: 4b10df6a1026885ad9770e6b9e594575356cd0c2d0dbd15aa775ab0ac67c6a079749bf2dbcacce5405ba5cc341481b0ef84a172e6654a3db893476b2326466ee
7
+ data.tar.gz: 5426af26c8efde7f68b519e3ad7b151291b897fa8d6503c408b0e6c8bcca699554e80e7319ee7afb908a3fd2fd1390d2d59f31f78e1dfe04043d8eb8a26633de
@@ -8,26 +8,36 @@ module Airbrake
8
8
  Route = Struct.new(:path, :controller, :action)
9
9
 
10
10
  def routes
11
- @routes ||= [*app_routes, *engine_routes].map do |route|
12
- Route.new(
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
- ::Rails.application.routes.routes.routes
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
@@ -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
 
@@ -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.4.1'.freeze
4
+ AIRBRAKE_VERSION = '9.4.2'.freeze
5
5
  end
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.1
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-05 00:00:00.000000000 Z
11
+ date: 2019-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: airbrake-ruby