There was a bug where if 'edit --ex' was invoked in a patched method context
it would instead to the equivalent of 'edit --method' (patching the current method
rather than the exception)
Some tests are still failing, though. This commit fixes wrong usage of
temporary paths on Windows. Please, note: the `edit` command is working
well; the issue is in poor tests.
Prettify some ugly code in `spec/editor_spec.rb`.
Unfortunately nested assignments to @old_editor meant that the
original @old_editor was permanently lost. This caused sporadic
failures of spec/editor_spec.rb which was relying on Pry.config.editor
containing a string.
* --method doesn't accept any parameters, it only edits the 'current' method associated
with the binding. It's equivalent to 'edit-method' (with no args).
* This option is necessary as 'edit' by itself edits the last expression.
* Note that --method doesn't just edit the current method, if no method exists (i.e binding.pry was not put
inside a method context) then it edits the current OBJECT instead.
TODO:
* explicitly restrict --method to *just* methods and not allow it to fall back to objects?
* allow --method to take a parameter that must be a method object? e.g --method Pry#repl works
but --method Pry would fail ?
Suffix of "*.rb" caused temp files to be named with "*.rb"
at the end, literally. Not all file systems like that, and
it's almost certainly not what was intended.
* 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)