Sha256: 722b276581a4fdd57c397f61ff439e945a82f7d590ed3568c97c1f7dc8c2f048

Contents?: true

Size: 592 Bytes

Versions: 4

Compression:

Stored size: 592 Bytes

Contents

require "interception"

require "did_you_mean/version"
require "did_you_mean/core_ext/name_error"
require "did_you_mean/core_ext/no_method_error"
require "did_you_mean/finders"

module DidYouMean
  Interception.listen(->(exception, binding) {
    # On IRB/pry console, this event is called twice. In the second event,
    # we get IRB/pry binding. So it shouldn't override @frame_binding if
    # it's already defined.
    if exception.is_a?(NameError) && !exception.instance_variable_defined?(:@frame_binding)
      exception.instance_variable_set(:@frame_binding, binding)
    end
  })
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
did_you_mean-0.9.10-java lib/did_you_mean.rb
did_you_mean-0.9.10 lib/did_you_mean.rb
did_you_mean-0.9.9-java lib/did_you_mean.rb
did_you_mean-0.9.9 lib/did_you_mean.rb