Skip to content

Commit 963c6dd

Browse files
committed
feat: Label system.exec, string.pack, string.html_safe
1 parent c9b6cdb commit 963c6dd

File tree

5 files changed

+57
-9
lines changed

5 files changed

+57
-9
lines changed

lib/appmap/builtin_hooks/marshal.yml

-8
This file was deleted.

lib/appmap/builtin_hooks/open3.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
- methods:
2+
- Open3#capture2
3+
- Open3#capture2e
4+
- Open3#capture3
5+
- Open3#pipeline
6+
- Open3#pipeline_r
7+
- Open3#pipeline_rw
8+
- Open3#pipeline_start
9+
- Open3#pipeline_w
10+
- Open3#popen2
11+
- Open3#popen2e
12+
- Open3#popen3
13+
label: system.exec

lib/appmap/builtin_hooks/ruby.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
- methods:
2+
- Marshal#load
3+
- Marshal#restore
4+
require_name: ruby
5+
label: deserialize.unsafe
6+
- method: Marshal#dump
7+
require_name: ruby
8+
label: serialize
9+
- method: String#pack
10+
require_name: ruby
11+
label: string.pack
12+
- methods:
13+
- String#unpack
14+
- String#unpack1
15+
require_name: ruby
16+
label: string.unpack
17+
- methods:
18+
# TODO: eval does not happen in the right context, and therefore any new constants
19+
# which are defined are placed on the wrong module/class.
20+
# - Kernel#eval
21+
- Binding#eval
22+
- BasicObject#instance_eval
23+
# These methods cannot be hooked as far as I can tell.
24+
# Why? When calling one of these functions, the context at the point of
25+
# definition is used. It's not possible to bind class_eval to a new context.
26+
# - Module#class_eval
27+
# - Module#module_eval
28+
require_name: ruby
29+
label: lang.eval
30+
- methods:
31+
- IO#popen
32+
- Kernel#exec
33+
- Kernel#spawn
34+
- Kernel#syscall
35+
- Kernel#system
36+
- Process#exec
37+
- Process#spawn
38+
require_name: ruby
39+
label: system.exec

lib/appmap/gem_hooks/actionview.yml

+4
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@
1111
label: mvc.template.resolver
1212
handler_class: AppMap::Handler::Rails::Template::ResolverHandler
1313
require_name: action_view
14+
- methods:
15+
- ActionView::Helpers::SanitizeHelper#sanitize
16+
label: string.html_safe
17+
require_name: action_view

test/gem_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_record_gem
2424
appmap_file = 'tmp/appmap/minitest/Parser_parser.appmap.json'
2525
appmap = JSON.parse(File.read(appmap_file))
2626
events = appmap['events']
27-
assert_equal 2, events.size
27+
assert_equal 6, events.size
2828
assert_equal 'call', events.first['event']
2929
assert_equal 'default_parser', events.first['method_id']
3030
assert_match /\lib\/parser\/base\.rb$/, events.first['path']

0 commit comments

Comments
 (0)