diff --git a/lib/pry/config.rb b/lib/pry/config.rb index bcd9370d..acb61c8b 100644 --- a/lib/pry/config.rb +++ b/lib/pry/config.rb @@ -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 diff --git a/lib/pry/pry_class.rb b/lib/pry/pry_class.rb index a836e005..5a2fe3d1 100644 --- a/lib/pry/pry_class.rb +++ b/lib/pry/pry_class.rb @@ -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 diff --git a/test/helper.rb b/test/helper.rb index 237e5ec8..9aae3980 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -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