appmap 0.83.0 → 0.83.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: 447831123769ff227fed969398dbaad500f5c002e976414ed3cc10e914d2b76e
4
- data.tar.gz: 47bdb94fbe52785cc7f68fbdfc20d9d50e96a33173dba68e52ab58334eaa5d84
3
+ metadata.gz: bea854bed738de049b48a7159db72bf00050b12e59e83f24f4353ae86eec352e
4
+ data.tar.gz: 1560fcc80b2583b4d710e1ddfbc446d47d4b70b69b1a29db735afbfea90ecf19
5
5
  SHA512:
6
- metadata.gz: 790f9967ee6d587acc2c21e594b3147487b798c5d0f83ff52495af3d51b7be80796ba4e68c379055e2accb151a067965a9c8925a38432151b8bb74c5361f6f7a
7
- data.tar.gz: ac70307f9221d105c86cc5919e31d3eb4d23f4a91b8c04578ba6d3b8425628d2cd89f90af706f607cce9ae4c5f3eabc4a3237d9a47456f13244b0800e72c4078
6
+ metadata.gz: c8ac080bd189b48409710623abb20363775bdd24f01be061b8f61ab199b88b04bdea674d6bd51a85b06d8dca6086ea2172e04b48d3a199971e67287229fb4c81
7
+ data.tar.gz: 8fc2ca5673a67d4f213744aec18eb26cf2951a7992a750659024370127b70072ae891721262a575cbaf3cffae75aa4d052061265c0687d04b4455b012887bc6e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
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
+
8
+ ## [0.83.2](https://github.com/applandinc/appmap-ruby/compare/v0.83.1...v0.83.2) (2022-05-11)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Only warn if Hook::LOG is true ([0ffd29e](https://github.com/applandinc/appmap-ruby/commit/0ffd29ea3a49d70af64193250c633668eb45c9ab))
14
+
15
+ ## [0.83.1](https://github.com/applandinc/appmap-ruby/compare/v0.83.0...v0.83.1) (2022-05-05)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * Allow appmap_dir, language and additional properties ([a3bb87c](https://github.com/applandinc/appmap-ruby/commit/a3bb87cb4a87d00a7196f21c45dfcaaf6502e014))
21
+
1
22
  # [0.83.0](https://github.com/applandinc/appmap-ruby/compare/v0.82.0...v0.83.0) (2022-04-29)
2
23
 
3
24
 
data/config-schema.yml CHANGED
@@ -1,10 +1,14 @@
1
1
  type: object
2
- additionalProperties: false
2
+ additionalProperties: true
3
3
  required:
4
4
  - name
5
5
  properties:
6
6
  name:
7
7
  type: string
8
+ language:
9
+ type: string
10
+ appmap_dir:
11
+ type: string
8
12
  packages:
9
13
  type: array
10
14
  items:
@@ -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
- return do_call(receiver, *args, &block) unless trace?
12
-
13
- call_event = with_disabled_hook { before_hook receiver, *args }
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
- return do_call(receiver, *args, **kwargs, &block) unless trace?
9
-
10
- call_event = with_disabled_hook { before_hook receiver, *args, **kwargs }
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
@@ -75,7 +75,7 @@ module AppMap
75
75
 
76
76
  return cls if cls
77
77
 
78
- warn "#{hook_method.name} not found on #{hook_class}"
78
+ warn "#{hook_method.name} not found on #{hook_class}" if Hook::LOG
79
79
  end
80
80
 
81
81
  def gettime
@@ -3,7 +3,7 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.83.0'
6
+ VERSION = '0.83.3'
7
7
 
8
8
  APPMAP_FORMAT_VERSION = '1.7.0'
9
9
 
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ # rubocop:disable Style/EvalWithLocation
4
+
5
+ module AppMap
6
+ class SpecClasses
7
+ class WithEval
8
+ eval %(def text; 'text'; end)
9
+ end
10
+ end
11
+ end
12
+
13
+ # rubocop:enable Style/EvalWithLocation
@@ -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.0
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-04-29 00:00:00.000000000 Z
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