Sha256: ca5e1be3b1594913466e4c2d1d999256a225781ef37390e95dbf1a3063ed4c06

Contents?: true

Size: 334 Bytes

Versions: 5

Compression:

Stored size: 334 Bytes

Contents

module Rubrowser
  class Trace
    def initialize(path: '')
      @path = path
    end

    def run
      trace_point.enable
    end

    private

    attr_reader :path

    def trace_point
      @trace_point ||= TracePoint.new(:call) do |tp|
        $wr.puts tp.defined_class if tp.path.start_with?(path)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubrowser-2.11 lib/rubrowser/trace.rb
rubrowser-2.10 lib/rubrowser/trace.rb
rubrowser-2.9.1 lib/rubrowser/trace.rb
rubrowser-2.9.0 lib/rubrowser/trace.rb
rubrowser-2.8.0 lib/rubrowser/trace.rb