Skip to content

Commit

Permalink
Note areas to remove
Browse files Browse the repository at this point in the history
  • Loading branch information
bf4 committed Feb 16, 2021
1 parent 83ede1d commit 3538f23
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/pry/cli.rb
Expand Up @@ -35,6 +35,7 @@ def add_options(&block)
self
end

# TODO: Remove add_plugin_options when removing plugin auto-loading
# Bring in options defined in plugins
def add_plugin_options
Pry::Warning.warn "Pry.plugins is deprecated and will be removed entirely"
Expand Down Expand Up @@ -125,13 +126,15 @@ def start(opts)
end
end

# TODO: Remove enable-plugins when removing plugin auto-loading
# Bring in options defined by plugins
Pry::Slop.new do
on "enable-plugins" do
Pry.config.should_load_plugins = true
end
end.parse(ARGV.dup)

# TODO: Remove add_plugin_options when removing plugin auto-loading
Pry::CLI.add_plugin_options if Pry.config.should_load_plugins

# The default Pry command line options (before plugin options are included)
Expand Down
1 change: 1 addition & 0 deletions lib/pry/config.rb
Expand Up @@ -73,6 +73,7 @@ class Config
# @return [Boolean] whether the local ./.pryrc should be loaded
attribute :should_load_local_rc

# TODO: Remove should_load_plugins when removing plugin auto-loading
# @return [Boolean]
attribute :should_load_plugins

Expand Down
8 changes: 7 additions & 1 deletion lib/pry/pry_class.rb
Expand Up @@ -24,6 +24,7 @@ class << self
attr_accessor :last_internal_error
attr_accessor :config

# TODO: Remove def_delegators :@plugin_manager when removing plugin auto-loading
def_delegators :@plugin_manager, :plugins, :load_plugins, :locate_plugins

def_delegators(
Expand Down Expand Up @@ -142,6 +143,7 @@ def self.final_session_setup
return if @session_finalized

@session_finalized = true
# TODO: Remove load_plugins when removing plugin auto-loading
load_plugins if Pry.config.should_load_plugins
load_requires if Pry.config.should_load_requires
load_history if Pry.config.history_load
Expand Down Expand Up @@ -333,9 +335,13 @@ def self.reset_defaults

# Basic initialization.
def self.init
# TODO: Remove PluginManager when removing plugin auto-loading
@plugin_manager ||= PluginManager.new
reset_defaults
locate_plugins
if Pry.config.should_load_plugins # rubocop:disable Style/GuardClause
# TODO: Remove locate_plugins when removing plugin auto-loading
locate_plugins
end
end

# Return a `Binding` object for `target` or return `target` if it is
Expand Down

0 comments on commit 3538f23

Please sign in to comment.