1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
Commit graph

7 commits

Author SHA1 Message Date
John Mair
92c345aa12 module_candidate.rb improved class lookup regex
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)
2012-12-27 23:02:53 +01:00
Kyrylo Silin
5cb356f731 Refactor 'command_lookup'
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>
2012-12-27 13:29:27 +02:00
Kyrylo Silin
73820fa08a Ensure nil doesn't freak out #find_command
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>
2012-12-27 13:29:27 +02:00
John Mair
2f0c4c28a6 Pry::CodeObject, allow lookups for methods of the form: local#method
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
2012-12-22 22:59:03 +01:00
John Mair
81554dda0a migrating show-source over to new Pry::CodeObject API 2012-12-20 18:05:42 +01:00
John Mair
405aacf76d added ability to extract an implicit object from binding when no string is given 2012-12-20 18:05:42 +01:00
John Mair
bbd4df87d4 started code_object stuff 2012-12-20 18:05:42 +01:00