appmap 0.83.2 → 0.83.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/appmap/hook/method/ruby2.rb +7 -3
- data/lib/appmap/hook/method/ruby3.rb +7 -3
- data/lib/appmap/version.rb +1 -1
- data/spec/handler/class_with_eval.rb +13 -0
- data/spec/handler/eval_spec.rb +7 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bea854bed738de049b48a7159db72bf00050b12e59e83f24f4353ae86eec352e
|
4
|
+
data.tar.gz: 1560fcc80b2583b4d710e1ddfbc446d47d4b70b69b1a29db735afbfea90ecf19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8ac080bd189b48409710623abb20363775bdd24f01be061b8f61ab199b88b04bdea674d6bd51a85b06d8dca6086ea2172e04b48d3a199971e67287229fb4c81
|
7
|
+
data.tar.gz: 8fc2ca5673a67d4f213744aec18eb26cf2951a7992a750659024370127b70072ae891721262a575cbaf3cffae75aa4d052061265c0687d04b4455b012887bc6e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.83.3](https://github.com/applandinc/appmap-ruby/compare/v0.83.2...v0.83.3) (2022-06-03)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Eval handler now works correctly even when not tracing ([4c9c40a](https://github.com/applandinc/appmap-ruby/commit/4c9c40abd8c930837ce6e040c72893f284ce0899))
|
7
|
+
|
1
8
|
## [0.83.2](https://github.com/applandinc/appmap-ruby/compare/v0.83.1...v0.83.2) (2022-05-11)
|
2
9
|
|
3
10
|
|
@@ -8,9 +8,9 @@ module AppMap
|
|
8
8
|
# cf. https://eregon.me/blog/2019/11/10/the-delegation-challenge-of-ruby27.html
|
9
9
|
class Method
|
10
10
|
ruby2_keywords def call(receiver, *args, &block)
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
call_event = trace? && with_disabled_hook { before_hook receiver, *args }
|
12
|
+
# note we can't short-circuit directly to do_call because then the call stack
|
13
|
+
# depth changes and eval handler doesn't work correctly
|
14
14
|
trace_call call_event, receiver, *args, &block
|
15
15
|
end
|
16
16
|
|
@@ -32,7 +32,10 @@ module AppMap
|
|
32
32
|
hook_method.bind(receiver).call(*args, &block)
|
33
33
|
end
|
34
34
|
|
35
|
+
# rubocop:disable Metrics/MethodLength
|
35
36
|
ruby2_keywords def trace_call(call_event, receiver, *args, &block)
|
37
|
+
return do_call(receiver, *args, &block) unless call_event
|
38
|
+
|
36
39
|
start_time = gettime
|
37
40
|
begin
|
38
41
|
return_value = do_call(receiver, *args, &block)
|
@@ -44,6 +47,7 @@ module AppMap
|
|
44
47
|
if call_event
|
45
48
|
end
|
46
49
|
end
|
50
|
+
# rubocop:enable Metrics/MethodLength
|
47
51
|
|
48
52
|
def hook_method_def
|
49
53
|
this = self
|
@@ -5,9 +5,9 @@ module AppMap
|
|
5
5
|
# Delegation methods for Ruby 3.
|
6
6
|
class Method
|
7
7
|
def call(receiver, *args, **kwargs, &block)
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
call_event = trace? && with_disabled_hook { before_hook receiver, *args, **kwargs }
|
9
|
+
# note we can't short-circuit directly to do_call because then the call stack
|
10
|
+
# depth changes and eval handler doesn't work correctly
|
11
11
|
trace_call call_event, receiver, *args, **kwargs, &block
|
12
12
|
end
|
13
13
|
|
@@ -34,7 +34,10 @@ module AppMap
|
|
34
34
|
hook_method.bind_call(receiver, *args, **kwargs, &block)
|
35
35
|
end
|
36
36
|
|
37
|
+
# rubocop:disable Metrics/MethodLength
|
37
38
|
def trace_call(call_event, receiver, *args, **kwargs, &block)
|
39
|
+
return do_call(receiver, *args, **kwargs, &block) unless call_event
|
40
|
+
|
38
41
|
start_time = gettime
|
39
42
|
begin
|
40
43
|
return_value = do_call(receiver, *args, **kwargs, &block)
|
@@ -46,6 +49,7 @@ module AppMap
|
|
46
49
|
if call_event
|
47
50
|
end
|
48
51
|
end
|
52
|
+
# rubocop:enable Metrics/MethodLength
|
49
53
|
|
50
54
|
def hook_method_def
|
51
55
|
this = self
|
data/lib/appmap/version.rb
CHANGED
data/spec/handler/eval_spec.rb
CHANGED
@@ -57,6 +57,11 @@ describe 'AppMap::Handler::Eval' do
|
|
57
57
|
end
|
58
58
|
expect(new_cls.const_get(class_name)).to eq(cls)
|
59
59
|
end
|
60
|
+
|
61
|
+
it 'works correctly when loaded even when not tracing' do
|
62
|
+
load "#{__dir__}/class_with_eval.rb"
|
63
|
+
expect { AppMap::SpecClasses::WithEval.new.text }.to_not raise_error(NameError)
|
64
|
+
end
|
60
65
|
end
|
61
66
|
|
62
67
|
module ClassMaker
|
@@ -64,3 +69,5 @@ module ClassMaker
|
|
64
69
|
eval "class #{class_name}; end; #{class_name}"
|
65
70
|
end
|
66
71
|
end
|
72
|
+
|
73
|
+
# rubocop:enable Security/Eval, Style/EvalWithLocation
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.83.
|
4
|
+
version: 0.83.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Gilpin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -707,6 +707,7 @@ files:
|
|
707
707
|
- spec/fixtures/rails7_users_app/test/models/instructor_test.rb
|
708
708
|
- spec/fixtures/rails7_users_app/test/system/.keep
|
709
709
|
- spec/fixtures/rails7_users_app/test/test_helper.rb
|
710
|
+
- spec/handler/class_with_eval.rb
|
710
711
|
- spec/handler/eval_spec.rb
|
711
712
|
- spec/hook_spec.rb
|
712
713
|
- spec/open_spec.rb
|