rails_tracepoint_stack 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_tracepoint_stack.rb +12 -7
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fcdfb6d987f930a294785da2decd147c1f9f7c1e95ca5815f5f4aba38b0d81b
|
4
|
+
data.tar.gz: f02ced7d9f7413d101f16945737c0a3b8dabc3028859c787ccb63c2922d88da4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8adede1acb4f3391aa435070d2b0f1a8447c282bf85f35236ce25459401074e3b5d99beb66b3d6053d86b0d14a03060dcc209b30e0e5a0fca3b5a793432037e0
|
7
|
+
data.tar.gz: ba27381d62e176251babd86041f7362e44552987359dd66950a82b47b24a88d8026a0aa191b582c04076df05c6eefc650748766425ceaba4b6d1e70ccb746a0d
|
@@ -1,9 +1,10 @@
|
|
1
|
+
$rails_tracer_rtps = nil
|
1
2
|
|
2
|
-
class
|
3
|
+
class RailsTracepointStack
|
3
4
|
def initialize
|
4
5
|
@gem_paths = Bundler.load.specs.map(&:full_gem_path)
|
5
6
|
@ruby_lib_path = RbConfig::CONFIG['rubylibdir']
|
6
|
-
end
|
7
|
+
end
|
7
8
|
|
8
9
|
def tracer
|
9
10
|
@trace ||= TracePoint.new(:call) do |tp|
|
@@ -29,13 +30,17 @@ class TracepointStack
|
|
29
30
|
end
|
30
31
|
|
31
32
|
def from_gempath_or_lib_path?(tp)
|
32
|
-
gem_paths.any? { |path| tp.path.start_with?(path) } ||
|
33
|
+
gem_paths.any? { |path| tp.path.start_with?(path) } ||
|
34
|
+
tp.path.start_with?(ruby_lib_path) ||
|
35
|
+
tp.path.include?("gems/bundler")
|
33
36
|
end
|
34
37
|
end
|
35
38
|
|
36
|
-
|
37
|
-
tracer
|
39
|
+
if ENV.fetch('RAILS_TRACEPOINT_STACK', 'false') == 'true'
|
40
|
+
$rails_tracer_rtps = RailsTracepointStack.new.tracer
|
41
|
+
$rails_tracer_rtps.enable
|
38
42
|
|
39
|
-
at_exit do
|
40
|
-
|
43
|
+
at_exit do
|
44
|
+
$rails_tracer_rtps.disable
|
45
|
+
end
|
41
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_tracepoint_stack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Daniel Pohlod
|
@@ -22,7 +22,8 @@ files:
|
|
22
22
|
homepage: https://github.com/carlosdanielpohlod/rails_tracepoint_stack/
|
23
23
|
licenses:
|
24
24
|
- MIT
|
25
|
-
metadata:
|
25
|
+
metadata:
|
26
|
+
documentation_uri: https://github.com/carlosdanielpohlod/rails_tracepoint_stack/
|
26
27
|
post_install_message:
|
27
28
|
rdoc_options: []
|
28
29
|
require_paths:
|
@@ -31,7 +32,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
31
32
|
requirements:
|
32
33
|
- - ">="
|
33
34
|
- !ruby/object:Gem::Version
|
34
|
-
version: '0'
|
35
|
+
version: '3.0'
|
35
36
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
37
|
requirements:
|
37
38
|
- - ">="
|