| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change is aimed to simplify #1843 (Rework the Pry config).
Current command state implementation gets in the way. We would like to simplify
the Config class. The current implementation penetrates Pry codebase everywhere,
and during my rework of the config I discovered that `watch` uses global command
state.
It means the state should survive `Pry.new` calls. With my (unpublished yet)
implementation, the `watch` command fails to do so. I realised that we can
refactor command state implementation to be global. It makes sense to me and
also helps with the Config refactoring.
With help of a dedicated class we can easily manage the command
state (resetting).
|
|\
| |
| | |
Gemfile: lock rspec-expectations to v3.8.2
|
|/
|
|
|
|
|
|
|
|
|
| |
v3.8.2 has a bug on Ruby 1.9.3:
https://github.com/rspec/rspec-expectations/issues/1113
```
TypeError: bind argument must be an instance of Kernel
```
Lock for now, unlock when (if) fixed version is released.
|
|\
| |
| | |
commands/watch_expression: use command state instead of config
|
|/
|
|
|
|
| |
It seems like this command defines options on the config as the user uses
Pry. This is wrong. We have command state API for this purpose. Configuration
should be done before Pry is initialized.
|
|\
| |
| | |
config: factor out control_d_handler to ControlDHandler
|
| | |
|
|\ \
| |/
| | |
config: factor out 'system' to SystemCommandHandler
|
| | |
|
|\ \
| |/
| | |
config: factor out exception_handler hook to a separate class
|
|/ |
|
|\
| |
| | |
config: factor out color printer proc to ColorPrinter
|
|/ |
|
|\
| |
| | |
config: factor out default hook definition to Pry::Hooks
|
|/ |
|
|\
| |
| | |
Move history file detection to Pry::History
|
|/
|
|
|
| |
This makes `Pry::Config` a bit cleaner and history code is better off in
`Pry::History`, since it's probably the most expected location.
|
|\
| |
| | |
Move `default_editor_for_platform` to Pry::Editor
|
|/
|
|
|
| |
The name strongly suggests that this method belongs to `Pry::Editor` and it
makes no sense to have it on `Pry` class.
|
|\
| |
| | |
Command class refactoring & adding tests
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
We also refactor it to use `case` instead of `if`.
|
| |
| |
| |
| |
| |
| | |
This has been "backwards compatible" for 8 years or so, so it's time to drop it
to reduce complexity of the codebase. I am not even sure what this is about and
it's likely not relevant.
|
| |
| |
| |
| |
| | |
This order makes more sense to me because it follows traditional scheme: class
methods first, instance methods next.
|
| | |
|
|/ |
|
|\
| |
| | |
command: delete #hooks
|
|/
|
|
| |
This was deprecated 4 years ago, so I guess it's time to remove it.
|
| |
|
|\
| |
| | |
command_set: refactor specs
|
|/
|
|
|
|
|
| |
In this change we:
* Used modern RSpec API
* Deleted unused methods
|
|\
| |
| | |
Delete commands/disabled_commands
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* the name of the method is not a verb, which is confusing
* commands have aliases
* we can deprecate commands at the place where they are defined. We would've
avoided this case with `edit-method` where the command was deprecated for
years but never removed. This is because it was deprecated using
`#disabled_commands` at an unexpected location.
|
|/
|
|
| |
These comands were 'disabled' 6 years ago, it's about damn time to delete them.
|
|\
| |
| | |
helpers/command_helpers: add tests, refactor variable names
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First of all, we move the spec file from `spec` to `spec/helpers`. This is where
it is supposed to be.
Next, we add tests for all the methods that the module defines. During this
process I had to change `module_function` to `extend self`. Rubocop doesn't like
it for some unknown to me reason, so I had to disable the rule. There's no harm
in doing so.
Finally, I refactored some methods (low-hanging fruits only) and discovered that
the `command_error` method is not necessary at all.
All in all, this module is a lot better now but I feel like it shouldn't exist
at all, since almost all methods are very specific to certain Pry commands. It's
hardly a general purpose module for Pry plugins.
|
|\
| |
| | |
Improve ColorPrinter and its unit tests
|
| |
| |
| |
| | |
Some code paths were not covered by unit tests.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Changes:
* method extractions
* indentation fixes
* brackets for methods
* clearer variable names
|
| | |
|
| |
| |
| |
| | |
This is needed for $DEFAULT_OUTPUT to work. Otherwise it's equal to `nil`.
|
|/ |
|
| |
|
|\
| |
| | |
Factor out all CodeRay code to Pry::SyntaxHighlighter
|
|/
|
|
|
|
|
|
| |
This moves all the code related syntax highlighting and tokenization to a
wrapper class of CodeRay. Benefits:
* we reduce duplication (no need to call `scan(code, :ruby).term` everywhere)
* swapping CodeRay becomes easier because it's isolated in one class
|
|\
| |
| | |
Rubocop fixes
|
| | |
|
| | |
|