summaryrefslogtreecommitdiff
path: root/lib/pry/pry_instance.rb
diff options
context:
space:
mode:
authorKyrylo Silin <silin@kyrylo.org>2019-04-29 19:21:54 +0300
committerKyrylo Silin <silin@kyrylo.org>2019-04-29 20:06:51 +0300
commit09ebd358e19ca169b5c5e5debdbc021dfaccf524 (patch)
tree2af260903896bee9498d2dff0bdd701a9fe719d3 /lib/pry/pry_instance.rb
parentba18ef32adf0c43bfe4130251b612be44513d990 (diff)
downloadpry-command-global-state.tar.gz
pry_instance: factor out command state to be globalcommand-global-state
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).
Diffstat (limited to 'lib/pry/pry_instance.rb')
-rw-r--r--lib/pry/pry_instance.rb2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb
index 9269ded7..e1309ce9 100644
--- a/lib/pry/pry_instance.rb
+++ b/lib/pry/pry_instance.rb
@@ -34,7 +34,6 @@ class Pry
attr_accessor :last_dir
attr_reader :last_exception
- attr_reader :command_state
attr_reader :exit_value
# @since v0.12.0
@@ -72,7 +71,6 @@ class Pry
def initialize(options = {})
@binding_stack = []
@indent = Pry::Indent.new
- @command_state = {}
@eval_string = ""
@backtrace = options.delete(:backtrace) || caller
target = options.delete(:target)