Sha256: 3bc1bfee0f2bf385540fca1ea47ff7b2988e78536a457a67a046925f228e5ee9

Contents?: true

Size: 774 Bytes

Versions: 8

Compression:

Stored size: 774 Bytes

Contents

# frozen_string_literal: true

require_relative 'trace_location/collector'
require_relative 'trace_location/config'
require_relative 'trace_location/report'
require_relative 'trace_location/version'

begin
  require 'rails'
  require_relative 'trace_location/railtie'
rescue LoadError
  nil
end

module TraceLocation # :nodoc:
  def self.trace(options = {}, &block)
    match = options.delete(:match)
    ignore = options.delete(:ignore)

    result = Collector.collect(match: match, ignore: ignore, &block)
    Report.build(result.events, result.return_value, options).generate
    true
  rescue StandardError => e
    $stdout.puts "Failure: #{e.message}"
    false
  end

  def self.configure
    yield config
  end

  def self.config
    @config ||= Config.new
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
trace_location-0.9.6 lib/trace_location.rb
trace_location-0.9.5 lib/trace_location.rb
trace_location-0.9.4 lib/trace_location.rb
trace_location-0.9.3.1 lib/trace_location.rb
trace_location-0.9.3 lib/trace_location.rb
trace_location-0.9.2 lib/trace_location.rb
trace_location-0.9.1 lib/trace_location.rb
trace_location-0.9.0 lib/trace_location.rb