Commit Graph

8 Commits

Author SHA1 Message Date
Kyrylo Silin ebccd57013 Convert all commands to classes
John "banister" Mair describes the following key features of commands
as classes:

  1. It enables people to extend them by either subclassing or
     monkeypatching.
  2. It enables them to provide their own API, so that for example, the
     Pry::Command::Edit class could have class methods for people to
     configure it.

Please, note that I didn't touch easter eggs commands. I also prettified
some strings (your source code reading experience should vastly improve!).

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
2012-12-27 13:31:37 +02:00
John Mair 407b20470a improve show-source/show-doc via Pry::CodeObject::Helpers mixin
Pry::CodeObject::Helpers mixin provides the following methods:
command?
module_with_yard_docs?
real_method_object?
c_method?

which are then mixed into the code objects: Pry::Command, Pry::Method, Pry::WrappedModule, Pry::WrappedModule::Candidate
2012-12-25 13:50:42 +01:00
John Mair 37b9fce976 show-source / show-doc: ensure _file_ and _line_ are set
Also cleaned up some OCD edge cases for show-doc, totally unnecessary & kind of silly
2012-12-22 22:59:03 +01:00
John Mair 9e7287a18f show-source/show-doc: temporaily adding complete() method to both commands
Until we find a better home for it, the code for the complete() method is exactly
the same in each case so we should come up with a way for show-source/show-doc to share it.
2012-12-21 16:57:19 +01:00
John Mair d19aef516e show-doc: Removed the horror of ModuleInstrospectionHelpers and method_options
show-doc should be a lot easier to grok now there are no hidden modules adding methods and doing spooky things
behind the scenes.
2012-12-21 16:41:52 +01:00
Reginald Tan 3836179181 Depracated show-command and moved its functionality to show-source
Also, show-doc on commands now displays their banner
2012-08-14 00:18:53 -04:00
Ryan Fitzgerald 1af4207c63 Restore groups, convert most commands to class syntax 2012-08-11 18:27:26 -07:00
Ryan Fitzgerald 8ce49ee081 Remove extended_commands, default_commands -> commands 2012-08-11 17:39:25 -07:00