Sha256: a21ad7907dc7e236d5a5097817eb7388caf14bbae65c24291530955f8e2cebca

Contents?: true

Size: 605 Bytes

Versions: 5

Compression:

Stored size: 605 Bytes

Contents

require 'did_you_mean/spell_checkers/name_error_checkers/class_name_checker'
require 'did_you_mean/spell_checkers/name_error_checkers/variable_name_checker'

module DidYouMean
  class << (NameErrorCheckers = Object.new)
    def new(exception)
      case exception.original_message
      when /uninitialized constant/
        ClassNameChecker
      when /undefined local variable or method/,
           /undefined method/,
           /uninitialized class variable/,
           /no member '.*' in struct/
        VariableNameChecker
      else
        NullChecker
      end.new(exception)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
did_you_mean-1.3.1 lib/did_you_mean/spell_checkers/name_error_checkers.rb
did_you_mean-1.2.2 lib/did_you_mean/spell_checkers/name_error_checkers.rb
did_you_mean-1.3.0 lib/did_you_mean/spell_checkers/name_error_checkers.rb
did_you_mean-1.2.1 lib/did_you_mean/spell_checkers/name_error_checkers.rb
did_you_mean-1.2.0 lib/did_you_mean/spell_checkers/name_error_checkers.rb