Class: Sorbet::Private::GemGeneratorTracepoint::Tracer

Inherits:
Object
  • Object
show all
Defined in:
lib/gem-generator-tracepoint/tracer.rb

Defined Under Namespace

Modules: ClassOverride, ModuleOverride, ObjectOverride

Class Method Summary collapse

Class Method Details

.finishObject



92
93
94
# File 'lib/gem-generator-tracepoint/tracer.rb', line 92

def self.finish
  disable_tracepoints
end

.on_method_added(mod, method, singleton) ⇒ Object



73
74
75
# File 'lib/gem-generator-tracepoint/tracer.rb', line 73

def self.on_method_added(mod, method, singleton)
  add_to_context(type: :method, module: mod, method: method, singleton: singleton)
end

.on_module_created(mod) ⇒ Object



61
62
63
# File 'lib/gem-generator-tracepoint/tracer.rb', line 61

def self.on_module_created(mod)
  add_to_context(type: :module, module: mod)
end

.on_module_extended(extended, extender) ⇒ Object



69
70
71
# File 'lib/gem-generator-tracepoint/tracer.rb', line 69

def self.on_module_extended(extended, extender)
  add_to_context(type: :extend, module: extender, extend: extended)
end

.on_module_included(included, includer) ⇒ Object



65
66
67
# File 'lib/gem-generator-tracepoint/tracer.rb', line 65

def self.on_module_included(included, includer)
  add_to_context(type: :include, module: includer, include: included)
end

.register_delegate_class(klass, delegate) ⇒ Object



57
58
59
# File 'lib/gem-generator-tracepoint/tracer.rb', line 57

def self.register_delegate_class(klass, delegate)
  @delegate_classes[Sorbet::Private::RealStdlib.real_object_id(delegate)] = klass
end

.startObject



86
87
88
89
# File 'lib/gem-generator-tracepoint/tracer.rb', line 86

def self.start
  pre_cache_module_methods
  install_tracepoints
end

.traceObject



78
79
80
81
82
83
# File 'lib/gem-generator-tracepoint/tracer.rb', line 78

def self.trace
  start
  yield
  finish
  trace_results
end

.trace_resultsObject



97
98
99
100
101
102
# File 'lib/gem-generator-tracepoint/tracer.rb', line 97

def self.trace_results
  {
    files: @files,
    delegate_classes: @delegate_classes
  }
end