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

17 commits

Author SHA1 Message Date
John Mair
7c8f9be176 Show error when no docs found 2013-03-10 00:19:10 +01:00
John Mair
b7e70db004 show-source/show-doc: Show the first module candidate with source/docs
Prior to this change `show-source ActiveRecord::Base` would fail, as the highest ranked
candidate couldn't be discovered.
2013-01-29 15:25:05 +01:00
John Mair
2e40eb24c6 re-add reload-method as an alias for reload-code
Turns out some people actually used reload-method, so we re-add it to avoid them getting angry
2013-01-29 15:25:05 +01:00
John Mair
a604fd6972 show-source: prettier error messages 2013-01-12 22:29:32 +01:00
Kyrylo Silin
256f35422a Prettify command descriptions, switches and stuff
Wrap command descriptions to 80 characters. Convert some string options
to symbols (where possible). Align options in code. Remove dots in the
end of switch descriptions.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
2013-01-09 22:23:19 +02:00
John Mair
c4dc8cffcd pull more show-source/show-doc methods into their superclass 2013-01-01 22:45:51 +01:00
John Mair
a5a4218660 Define a command superclass for show-source and show-doc
Pry::Command::ShowInfo is an abstract base class.
2013-01-01 21:25:23 +01:00
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
eda2c73afb make show-source code more readable 2012-12-20 20:46:33 +01:00
John Mair
47d30a139c free show-source from the horror of module_introspection_helpers.rb and method_options.rb
show-doc and edit and a variety of other commands can also be updated to use the new Pry::CodeObject API
2012-12-20 20:15:00 +01:00
John Mair
81554dda0a migrating show-source over to new Pry::CodeObject API 2012-12-20 18:05:42 +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
Renamed from lib/pry/default_commands/show_source.rb (Browse further)