Bug prevented lookup of Deeply::Nested::Class::Definitions.
Also properly differentiate when looking up docs/source for *commands* and for the class that represents the command, i.e:
show-doc show-source #=> displays show-source --help
show-doc Pry::Command::ShowSource #=> comments above class definition (as with any other class)
Thanks to Bacon we can use `before` method to simplify our life.
And, blimey, I accidentally left some unwanted code after myself!
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
When you pass `nil` to `BaseHelpers#find_command` and a command in `set`
doesn't have the `:listing` option (for example, when your command is a
regular Ruby class), `#find_command` will return that command (even if
it doesn't match at all).
command.options[:listing] #=> nil
name = nil
command.options[:listing] == name #=> true
Add tests to "code_object_spec.rb", because that's how I found this
shortage and it seems to be a natural test.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
the '#' used to be interpreted as a comment and so only 'local' and not the associated method was looked up.
Fixed this by letting strings of the form /\S#\S/ pass through to Pry::Method lookup