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

13 commits

Author SHA1 Message Date
Kyrylo Silin
d746eeffe3 ShowDoc: display "current context" message
Consider the following example:

  [1] pry(main)> show-doc
  Error: No docs found for:
  [2] pry(main)>

The message is ambiguous. This commit adds "current context" label when
`obj_name` return `nil`.

  [1] pry(main)> show-doc
  Error: No docs found for: current context
  [2] pry(main)>
2013-03-13 13:15:58 +02:00
John Mair
7c8f9be176 Show error when no docs found 2013-03-10 00:19:10 +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
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
Renamed from lib/pry/default_commands/show_doc.rb (Browse further)