lib/appmap/command/record.rb in appmap-0.23.0 vs lib/appmap/command/record.rb in appmap-0.25.0

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + module AppMap module Command RecordStruct = Struct.new(:config, :program) class Record < RecordStruct @@ -59,17 +61,14 @@ } end end def perform(&block) - features = AppMap.inspect(config) - functions = features.map(&:collect_functions).flatten + AppMap::Hook.hook(config) - require 'appmap/trace/tracer' + tracer = AppMap.tracing.trace - tracer = AppMap::Trace.tracers.trace(functions) - events = [] quit = false event_thread = Thread.new do while tracer.event? || !quit event = tracer.next_event @@ -83,10 +82,13 @@ event_thread.abort_on_exception = true at_exit do quit = true event_thread.join - yield features, events + yield AppMap::APPMAP_FORMAT_VERSION, + self.class.detect_metadata, + AppMap.class_map(config, tracer.event_methods), + events end load program if program end end