1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Replaced Pry.config.should_load_plugins with Pry.config.plugins.enabled. Also added Pry.config.plugins.strict_loading config option; also updated test helper to reflect changes

This commit is contained in:
John Mair 2011-06-02 21:41:41 +12:00
parent eb9238ab2b
commit 94a1f993e6
3 changed files with 13 additions and 3 deletions

View file

@ -81,6 +81,13 @@ class Pry
# saved to hist.file at session end.
# @return [OpenStruct]
attr_accessor :history
# Config option for plugins:
# sub-options include:
# `plugins.enabled` (Boolean) to toggle the loading of plugins on and off wholesale. (defaults to true)
# `plugins.strict_loading` (Boolean) which toggles whether referring to a non-existent plugin should raise an exception (defaults to `false`)
# @return [OpenStruct]
attr_accessor :plugins
end
end

View file

@ -96,7 +96,7 @@ class Pry
# we only want them loaded once per entire Pry lifetime, not
# multiple times per each new session (i.e in debugging)
load_rc if Pry.config.should_load_rc
load_plugins if Pry.config.should_load_plugins
load_plugins if Pry.config.plugins.enabled
load_history if Pry.config.history.load
@initial_session = false
@ -190,7 +190,10 @@ class Pry
config.pager = true
config.editor = default_editor_for_platform
config.should_load_rc = true
config.should_load_plugins = true
config.plugins ||= OpenStruct.new
config.plugins.enabled = true
config.plugins.strict_loading = true
config.history ||= OpenStruct.new
config.history.save = true

View file

@ -18,7 +18,7 @@ class << Pry
Pry.color = false
Pry.pager = false
Pry.config.should_load_rc = false
Pry.config.should_load_plugins = false
Pry.config.plugins.enabled = false
Pry.config.history.load = false
Pry.config.history.save = false
end