summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* pry_instance: factor out command state to be globalcommand-global-stateKyrylo Silin2019-04-2910-15/+98
| | | | | | | | | | | | | | | | | 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).
* Merge pull request #2019 from pry/rspec-expectations-version-lockKyrylo Silin2019-04-281-0/+5
|\ | | | | Gemfile: lock rspec-expectations to v3.8.2
| * Gemfile: lock rspec-expectations to v3.8.2Kyrylo Silin2019-04-281-0/+5
|/ | | | | | | | | | | 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.
* Merge pull request #2018 from pry/watch-expression-stateKyrylo Silin2019-04-281-1/+1
|\ | | | | commands/watch_expression: use command state instead of config
| * commands/watch_expression: use command state instead of configKyrylo Silin2019-04-281-1/+1
|/ | | | | | 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.
* Merge pull request #2014 from pry/exception-handler-refactoringKyrylo Silin2019-04-154-68/+67
|\ | | | | config: factor out control_d_handler to ControlDHandler
| * config: factor out control_d_handler to ControlDHandlerKyrylo Silin2019-04-154-68/+67
| |
* | Merge pull request #2013 from pry/exception-handler-refactoringKyrylo Silin2019-04-154-8/+51
|\ \ | |/ | | config: factor out 'system' to SystemCommandHandler
| * config: factor out 'system' to SystemCommandHandlerKyrylo Silin2019-04-154-8/+51
| |
* | Merge pull request #2012 from pry/exception-handler-refactoringKyrylo Silin2019-04-154-22/+107
|\ \ | |/ | | config: factor out exception_handler hook to a separate class
| * config: factor out exception_handler hook to a separate classexception-handler-refactoringKyrylo Silin2019-04-154-22/+107
|/
* Merge pull request #2011 from pry/color-printer-refactoringKyrylo Silin2019-04-145-10/+20
|\ | | | | config: factor out color printer proc to ColorPrinter
| * config: factor out color printer proc to ColorPrinterKyrylo Silin2019-04-145-10/+20
|/
* Merge pull request #2010 from pry/default-hooksKyrylo Silin2019-04-143-8/+39
|\ | | | | config: factor out default hook definition to Pry::Hooks
| * config: factor out default hook definition to Pry::HooksKyrylo Silin2019-04-143-8/+39
|/
* Merge pull request #2009 from pry/history-file-refactoringKyrylo Silin2019-04-104-17/+47
|\ | | | | Move history file detection to Pry::History
| * Move history file detection to Pry::HistoryKyrylo Silin2019-04-104-17/+47
|/ | | | | This makes `Pry::Config` a bit cleaner and history code is better off in `Pry::History`, since it's probably the most expected location.
* Merge pull request #2008 from pry/default-editor-refactoringKyrylo Silin2019-04-105-12/+54
|\ | | | | Move `default_editor_for_platform` to Pry::Editor
| * Move `default_editor_for_platform` to Pry::EditorKyrylo Silin2019-04-105-12/+54
|/ | | | | The name strongly suggests that this method belongs to `Pry::Editor` and it makes no sense to have it on `Pry` class.
* Merge pull request #2003 from pry/command-refactoringKyrylo Silin2019-04-098-894/+1102
|\ | | | | Command class refactoring & adding tests
| * spec/command: refactor to cover more, and more clearlyKyrylo Silin2019-04-092-619/+497
| |
| * Test ClassCommandKyrylo Silin2019-04-081-0/+264
| |
| * Test BlockCommandKyrylo Silin2019-04-081-0/+63
| |
| * command: rename #correct_arg_arity to #normalize_method_argsKyrylo Silin2019-04-083-11/+13
| | | | | | | | We also refactor it to use `case` instead of `if`.
| * block_command: delete backwards compatibility codeKyrylo Silin2019-04-082-3/+2
| | | | | | | | | | | | 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.
| * command: reorder methodsKyrylo Silin2019-04-081-54/+52
| | | | | | | | | | This order makes more sense to me because it follows traditional scheme: class methods first, instance methods next.
| * command: move BlockCommand to a separate fileKyrylo Silin2019-04-083-22/+24
| |
| * command: move ClassCommand to a separate fileKyrylo Silin2019-04-083-191/+193
|/
* Merge pull request #2004 from pry/command-hooks-removalKyrylo Silin2019-04-081-7/+1
|\ | | | | command: delete #hooks
| * command: delete #hooksKyrylo Silin2019-04-081-7/+1
|/ | | | This was deprecated 4 years ago, so I guess it's time to remove it.
* spec/command_set: delete unused ctxKyrylo Silin2019-04-061-8/+0
|
* Merge pull request #2002 from pry/command-set-refactoringKyrylo Silin2019-04-042-539/+288
|\ | | | | command_set: refactor specs
| * command_set: refactor specsKyrylo Silin2019-04-042-539/+288
|/ | | | | | | In this change we: * Used modern RSpec API * Deleted unused methods
* Merge pull request #2001 from pry/deprecated-command-removalKyrylo Silin2019-03-315-16/+6
|\ | | | | Delete commands/disabled_commands
| * command_set: delete #disabled_commandsKyrylo Silin2019-03-312-12/+3
| | | | | | | | | | | | | | | | | | * 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.
| * Delete commands/disabled_commandsKyrylo Silin2019-03-315-5/+4
|/ | | | These comands were 'disabled' 6 years ago, it's about damn time to delete them.
* Merge pull request #2000 from pry/command-helpers-specKyrylo Silin2019-03-306-93/+297
|\ | | | | helpers/command_helpers: add tests, refactor variable names
| * helpers/command_helpers: add tests, refactor variable namesKyrylo Silin2019-03-306-93/+297
|/ | | | | | | | | | | | | | | | | 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.
* Merge pull request #1999 from pry/color-printer-specsKyrylo Silin2019-03-302-51/+92
|\ | | | | Improve ColorPrinter and its unit tests
| * color_printer_spec: add more specsKyrylo Silin2019-03-301-1/+56
| | | | | | | | Some code paths were not covered by unit tests.
| * color_printer: cosmetic refactoringKyrylo Silin2019-03-301-40/+32
| | | | | | | | | | | | | | | | | | Changes: * method extractions * indentation fixes * brackets for methods * clearer variable names
| * color_printer: inline OBJ_COLOR so it's testableKyrylo Silin2019-03-301-10/+3
| |
| * color_printer: require EnglishKyrylo Silin2019-03-281-0/+1
| | | | | | | | This is needed for $DEFAULT_OUTPUT to work. Otherwise it's equal to `nil`.
| * color_printer: move class documentation above the class definitionKyrylo Silin2019-03-281-1/+1
|/
* Stop requiring coderay in files that don't use itKyrylo Silin2019-03-2810-17/+0
|
* Merge pull request #1998 from pry/coderay-wrapKyrylo Silin2019-03-2811-13/+40
|\ | | | | Factor out all CodeRay code to Pry::SyntaxHighlighter
| * Factor out all CodeRay code to Pry::SyntaxHighlighterKyrylo Silin2019-03-2811-13/+40
|/ | | | | | | | 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
* Merge pull request #1997 from pry/rubocop-fixesKyrylo Silin2019-03-248-72/+31
|\ | | | | Rubocop fixes
| * rubocop: ignore Gemspec/RequiredRubyVersionKyrylo Silin2019-03-242-7/+3
| |
| * rubocop: "fix" the Lint/ShadowedException copKyrylo Silin2019-03-242-6/+1
| |