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



82
83
84
# File 'lib/gem-generator-tracepoint/tracer.rb', line 82

def self.finish
  disable_tracepoints
end

.method_added(mod, method, singleton) ⇒ Object



63
64
65
# File 'lib/gem-generator-tracepoint/tracer.rb', line 63

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

.module_created(mod) ⇒ Object



51
52
53
# File 'lib/gem-generator-tracepoint/tracer.rb', line 51

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

.module_extended(extended, extender) ⇒ Object



59
60
61
# File 'lib/gem-generator-tracepoint/tracer.rb', line 59

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

.module_included(included, includer) ⇒ Object



55
56
57
# File 'lib/gem-generator-tracepoint/tracer.rb', line 55

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

.register_delegate_class(klass, delegate) ⇒ Object



47
48
49
# File 'lib/gem-generator-tracepoint/tracer.rb', line 47

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

.startObject



76
77
78
79
# File 'lib/gem-generator-tracepoint/tracer.rb', line 76

def self.start
  pre_cache_module_methods
  install_tracepoints
end

.traceObject



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

def self.trace
  start
  yield
  finish
  trace_results
end

.trace_resultsObject



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

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