module Bundler::Plugin

def load_plugin(name)

Parameters:
  • name (String) -- of the plugin
def load_plugin(name)
  return unless name && !name.empty?
  return if loaded?(name)
  # Need to ensure before this that plugin root where the rest of gems
  # are installed to be on load path to support plugin deps. Currently not
  # done to avoid conflicts
  path = index.plugin_path(name)
  Gem.add_to_load_path(*index.load_paths(name))
  load path.join(PLUGIN_FILE_NAME)
  @loaded_plugin_names << name
rescue RuntimeError => e
  Bundler.ui.error "Failed loading plugin #{name}: #{e.message}"
  raise
end