Activate the plugin (require the gem - enables/loads the plugin immediately at point of call, even if plugin is disabled) Does not reload plugin if it's already active.
# File lib/pry/plugins.rb, line 44 def activate! # Create the configuration object for the plugin. Pry.config.send("#{gem_name.gsub('-', '_')}=", OpenStruct.new) begin require gem_name if !active? rescue LoadError => e warn "Warning: The plugin '#{gem_name}' was not found! (gem found but could not be loaded)" warn e end self.active = true self.enabled = true end
Disable a plugin. (prevents plugin from being loaded, cannot disable an already activated plugin)
# File lib/pry/plugins.rb, line 25 def disable! self.enabled = false end
Enable a plugin. (does not load it immediately but puts on 'white list' to be loaded)
# File lib/pry/plugins.rb, line 31 def enable! self.enabled = true end
Load the Command line options defined by this plugin (if they exist)
# File lib/pry/plugins.rb, line 36 def load_cli_options cli_options_file = File.join(spec.full_gem_path, "lib/#{spec.name}/cli.rb") require cli_options_file if File.exists?(cli_options_file) end
Generated with the Darkfish Rdoc Generator 2.