Sha256: fc868e961d8030cb947412386ccf6b4cd99bc5b3568dfc5cc1ea1139e64db948

Contents?: true

Size: 775 Bytes

Versions: 1

Compression:

Stored size: 775 Bytes

Contents

require "did_you_mean/version"
require "did_you_mean/core_ext/name_error"

require "did_you_mean/spell_checkable"
require 'did_you_mean/spell_checkers/name_error_checkers'
require 'did_you_mean/spell_checkers/method_name_checker'
require 'did_you_mean/spell_checkers/null_checker'

require "did_you_mean/formatter"

module DidYouMean
  @@trace = TracePoint.new(:raise) do |tp|
    e = tp.raised_exception

    if SPELL_CHECKERS.include?(e.class.to_s) && !e.instance_variable_defined?(:@frame_binding)
      e.instance_variable_set(:@frame_binding, tp.binding)
    end
  end
  @@trace.enable

  IGNORED_CALLERS = []

  SPELL_CHECKERS = Hash.new(NullChecker)
  SPELL_CHECKERS.merge!({
    "NameError"     => NameErrorCheckers,
    "NoMethodError" => MethodNameChecker
  })
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
did_you_mean-1.0.0.beta3 lib/did_you_mean.rb