From: sawadatsuyoshi@... Date: 2020-01-28T20:26:24+00:00 Subject: [ruby-core:97012] [Ruby master Bug#16599] did_you_mean is not activated for NameError and KeyError Issue #16599 has been reported by sawa (Tsuyoshi Sawada). ---------------------------------------- Bug #16599: did_you_mean is not activated for NameError and KeyError https://bugs.ruby-lang.org/issues/16599 * Author: sawa (Tsuyoshi Sawada) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.6, 2.7, perhaps for earlier versions too * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- [This document](https://www.rubydoc.info/gems/did_you_mean/) claims that the did_you_mean gem responds to NameError, NoMethodError, and KeyError, but it actually seems to only respond to NoMethodError. ```ruby foo() # >> NoMethodError: undefined method `foo' for main:Object # >> Did you mean? for foo # >> NameError: undefined local variable or method `foo' for main:Object Foo # >> NameError: uninitialized constant Foo {foo: 1}.fetch(:bar) # >> KeyError: key not found: :bar ``` -- https://bugs.ruby-lang.org/ Unsubscribe: