rorvswild 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9e6a2963e38a065dfaba2af93a5d05275a18d6a57c9e3b12b80b027f8f6c605
4
- data.tar.gz: 953c30a7d822f9ea69b2c2ef16d96f7a16ed5765da2fa8d013982a553c1a06f8
3
+ metadata.gz: 5f458deb05f3508f795dc06993742ee466d8615e86886f5997bf0d1743d3adb0
4
+ data.tar.gz: ea17ef8609b1587c259a074a08f3b3657960b2fe8e76ac533ed3778464f820f5
5
5
  SHA512:
6
- metadata.gz: bad6d0f028f564619f7283f582fbf5f008f8cf5fcd5b38ab8036fb570438ef1e4e75d2bffeeff93f562f541dc4bdf7cbdf3b38435fc44d354c82f9fd01b7cc5b
7
- data.tar.gz: 31a9d64bbc3a6468022705025bab670c2dd3d156a9e35ba9241450f2d98a45c4f30448f25ceab7d7b983a21d251907dc3c4aeef6900084559a47b1c27841748b
6
+ metadata.gz: f7402dd0a270265faf614b4ea6919b1b9469b164a8b844b2814a73426a663ce83b144fc3208b2eae2dee3377a1d0f88ffe1e716e60fc3876e7a07ea9aad92127
7
+ data.tar.gz: 71cbe80cc68b6730ba128c44a96767d94e8b56e5ae02328b5cb4667443ad0b316280562e8eca567039d413db841fe5583e0dd8626e993dd7c7fe5715371c8b36
@@ -0,0 +1,31 @@
1
+ module RorVsWild
2
+ module Plugin
3
+ class Middleware
4
+ def self.setup
5
+ return if @installed
6
+ Rails.application.config.middleware.unshift(RorVsWild::Plugin::Middleware, nil) if defined?(Rails)
7
+ @installed = true
8
+ end
9
+
10
+ def initialize(app, config)
11
+ @app, @config = app, config
12
+ end
13
+
14
+ def call(env)
15
+ RorVsWild.agent.start_request
16
+ RorVsWild.agent.current_data[:path] = env["ORIGINAL_FULLPATH".freeze]
17
+ section = RorVsWild::Section.start
18
+ section.file, section.line = rails_engine_location
19
+ section.command = "Rails::Engine#call".freeze
20
+ @app.call(env)
21
+ ensure
22
+ RorVsWild::Section.stop
23
+ RorVsWild.agent.stop_request
24
+ end
25
+
26
+ def rails_engine_location
27
+ @rails_engine_location = ::Rails::Engine.instance_method(:call).source_location
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module RorVsWild
2
- VERSION = "1.5.2".freeze
2
+ VERSION = "1.5.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rorvswild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Bernard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-25 00:00:00.000000000 Z
11
+ date: 2020-05-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Performances and quality insights for rails developers.
14
14
  email:
@@ -39,7 +39,6 @@ files:
39
39
  - lib/rorvswild/local/stylesheet/vendor/prism.css
40
40
  - lib/rorvswild/locator.rb
41
41
  - lib/rorvswild/plugin/action_controller.rb
42
- - lib/rorvswild/plugin/action_dispatch.rb
43
42
  - lib/rorvswild/plugin/action_mailer.rb
44
43
  - lib/rorvswild/plugin/action_view.rb
45
44
  - lib/rorvswild/plugin/active_job.rb
@@ -47,6 +46,7 @@ files:
47
46
  - lib/rorvswild/plugin/delayed_job.rb
48
47
  - lib/rorvswild/plugin/elasticsearch.rb
49
48
  - lib/rorvswild/plugin/faktory.rb
49
+ - lib/rorvswild/plugin/middleware.rb
50
50
  - lib/rorvswild/plugin/mongo.rb
51
51
  - lib/rorvswild/plugin/net_http.rb
52
52
  - lib/rorvswild/plugin/redis.rb
@@ -1,27 +0,0 @@
1
- module RorVsWild
2
- module Plugin
3
- class ActionDispatch
4
- def self.setup
5
- return if @installed
6
- return unless defined?(::ActiveSupport::Notifications)
7
- ActiveSupport::Notifications.subscribe("request.action_dispatch", new)
8
- @installed = true
9
- end
10
-
11
- def start(name, id, payload)
12
- RorVsWild.agent.start_request
13
- RorVsWild.agent.current_data[:path] = payload[:request].original_fullpath
14
- @action_dispath_location ||= ::ActionDispatch::Executor.instance_method(:call).source_location
15
- section = RorVsWild::Section.start
16
- section.file, section.line = @action_dispath_location
17
- section.command = "ActionDispatch::Executor.#call".freeze
18
- section.kind = "code".freeze
19
- end
20
-
21
- def finish(name, id, payload)
22
- RorVsWild::Section.stop
23
- RorVsWild.agent.stop_request
24
- end
25
- end
26
- end
27
- end