Fix issue #877 (show-source -s doesn't work (when no method arg is
given))
This behaviour is shared between `show-source` and `show-doc`. So with
one fix I kill two bugs.
Add tests and rewrite some of the existing ones (related to the
`--super` switch).
The failures were due to Rbx recovering more source than expected (compared to MRI)
For example, the following fails in MRI:
module M
end
module N
include M
end
show-source N
but on rbx it succeeds and shows the source of N
How does rbx do it? It appears to create a secret method called __module_init__ on a module whenever you include another module.
This method has its source_location set to the `include` line.
When performing show-source/show-doc on a class whose code
cannot be extracted we now fall-back to its first accessible superclass
and show its code together with a warning.
Example:
class Model < ActiveRecord::Base
end
show-source Model #=> shows ActiveRecord::Base code
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>
* removed most historicla junk from lib/pry/test/helper.rb
* relocated recalcitrant junk to the local spec/helper.rb (this isn't exposed to 3rd parties)