* fixed pager bug (wouldn't render color codes in some circumstances)
Holds the last internal error (such as CommandError, Slop::InvalidOptionError, or MethodSource::SourceNotFoundError). Useful for debugging commands. Just set: _pry_.last_exception = Pry.last_internal_error
a bare 'rescue' will not catch a LoadError
We didn't send any flags to the pager, as a result ansi codes were not applied unless the user had properly set up their LESS env variable. This was often not the case, resulting in broken and ugly output. This commit sends along the proper flags whenever we use the pager, regardless of the user's LESS variable
* fix Pry.run_command * improve `ls` output * add :requires_gem => "jist" to 'gist' command (so deps can be installed via install-command) * improve help for 'edit' command
We put a conditional around tests so that we skip those those using show-source (namely the one in run_command_spec.rb) on ree/ruby18
The previous table output was geared mostly for `ls _pry_`, which isn't a common of hierarchy. After feedback from users such as @envygeeks, we found a few tweaks that would help the really-small layers such as those found in Rails or in small classes, namely: - Rolling it up onto one line, if possible - Highlighting the heading in the colors familiar to users of GNU ls for "directory" style Additionally, I took the opportunity for toning down the private/protected method colors, because before they were green and yellow, now they're both "muted terminal blue" Without the ability to really get in and really distinguish colors (e.g. using 256 colors), giving "protected" such a loud color seems wrong. Before recoloring: #813 (comment) After: #813 (comment)
- Opt-in because we aren't sure where it doesn't work - Not Coolline-aware - Otherwise a big improvement
The problem was that Pry#rep() no longer works on its own, it's necessary to use Pry#repl() instead. This is because many new API, like Pry::CodeObject.lookup now get the target binding directly from the _pry_ instance (Pry#current_context), rather than requiring it to be passed in separately. This saves us a parameter. The reason Pry#rep doesnt work with Pry::CodeObject.lookup (and so show-source/show-doc etc) is that the binding_stack is only set up in Pry#repl_prologue, and it is the binding_stack (via Pry#current_context) that is accessed by Pry::CodeObject and pals.
Oops, forgetting this meant that 'gist' command would error out with ugly messages rather than prompting the user to 'install-command'
minor bug fix for gist on windows, rescuing Jist::ClipboardError rather than letting the scary error spill out to users and potentially have them think the gist didnt post.
* forgot to remove 'no_arg' from Pry::Command::CodeCollector, this method no longer exists and so 'gist' (when not given any params) would break. Replaced no_arg with empty string "" so that 'gist' gists current object/method by default.
Final adjustments made to CHANGELOG and CONTRIBUTORS
This was a horrible mistake, it's stupidly annoying * in the case of 'rake pry' it warngs every time we do 'cd' (since 'cd' is a top-levle method defined by rake) That's all i can think of right now, but that's still annoying enough.
And rewrite edit-method / show-command to use this API.
This enables a simplified UI, i.e: gist my_file.rb instead of gist -f my_file.rb and `gist my_method` instead of `gist -m my_method`. Unfortunately, we had to kill our tests in the process of doing this (gist_spec.rb is just commented out) - however since play and save-file have tests and they use the same Pry::CodeCollector object 'gist' is indirectly tested. Nonetheless, we should re-add tests at some point
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)
This allows callers to know that CC is working on a file rather than ruby code.
It was creating a new Slop instance for its own needs, thus and so remove the previous abstraction for Slop commands. The `ClassCommand::Options` class should be removed because we don't need it anymore.
Make them use the new Slop syntax.
* use a plain old Slop instance instead of `Options`; * remove `ClassCommand::Options` and its tests; * add clearer subcommand example (for `Command#subcommand` method); * refactor `ClassCommand#slop`; * refactor `ClassCommand#complete`. Slop v3.4.0 has introduced full-featured subcommands. There is no need in Pry specific code anymore.
Slop v3.4.0 includes new syntax for subcommands. And we're going to utilise it.