add config to disable auto-reload
This commit is contained in:
parent
c8845bffb4
commit
3b955809ca
|
@ -75,6 +75,10 @@ class Pry
|
|||
# @return [Boolean]
|
||||
attr_accessor :should_load_requires
|
||||
|
||||
# Determines whether to disable edit-method's auto-reloading behavior.
|
||||
# @return [Boolean]
|
||||
attr_accessor :disable_auto_reload
|
||||
|
||||
# Config option for history.
|
||||
# sub-options include hist.file, hist.load, and hist.save
|
||||
# hist.file is the file to save/load history too, e.g
|
||||
|
|
|
@ -147,7 +147,7 @@ class Pry
|
|||
|
||||
opt.on :M, "instance-methods", "Operate on instance methods."
|
||||
opt.on :m, :methods, "Operate on methods."
|
||||
opt.on :n, "no-reload", "Do not automatically reload the method's file after editting."
|
||||
opt.on :n, "no-reload", "Do not automatically reload the method's file after editing."
|
||||
opt.on "no-jump", "Do not fast forward editor to first line of method."
|
||||
opt.on :c, :context, "Select object context to run under.", true do |context|
|
||||
target = Pry.binding_for(target.eval(context))
|
||||
|
@ -179,7 +179,7 @@ class Pry
|
|||
|
||||
invoke_editor(file, opts["no-jump"] ? 0 : line)
|
||||
silence_warnings do
|
||||
load file if !opts.n?
|
||||
load file if !opts.n? && !Pry.config.disable_auto_reload
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -198,6 +198,7 @@ class Pry
|
|||
config.pager = true
|
||||
config.editor = default_editor_for_platform
|
||||
config.should_load_rc = true
|
||||
config.disable_auto_reload = false
|
||||
|
||||
config.plugins ||= OpenStruct.new
|
||||
config.plugins.enabled = true
|
||||
|
|
Loading…
Reference in New Issue