Handles the installation of plugin in appropriate directories.
This class is supposed to be wrapper over the existing gem installation infra but currently it itself handles everything as the Source‘s subclasses (e.g. Source::RubyGems) are heavily dependent on the Gemfile.
| PLUGIN_FILE_NAME | = | "plugins.rb".freeze |
Evaluates the Gemfile with a limited DSL and installs the plugins specified by plugin method
@param [Pathname] gemfile path @param [Proc] block that can be evaluated for (inline) Gemfile
Runs all the hooks that are registered for the passed event
It passes the passed arguments and block to the block registered with the api.
@param [String] event
Installs a new plugin by the given name
@param [Array<String>] names the name of plugin to be installed @param [Hash] options various parameters as described in description.
Refer to cli/plugin for available options
Runs the plugins.rb file in an isolated namespace, records the plugin actions it registers for and then passes the data to index to be stored.
@param [String] name the name of the plugin @param [Specification] spec of installed plugin @param [Boolean] optional_plugin, removed if there is conflict with any
other plugin (used for default source plugins)
@raise [MalformattedPlugin] if plugins.rb raises any error
The directory root for all plugin related data
If run in an app, points to local root, in app_config_path Otherwise, points to global root, in Bundler.user_bundle_path("plugin")
Post installation processing and registering with index
@param [Array<String>] plugins list to be installed @param [Hash] specs of plugins mapped to installation path (currently they
contain all the installed specs, including plugins)
@param [Array<String>] names of inferred source plugins that can be ignored
@param [Hash] The options that are present in the lock file @return [API::Source] the instance of the class that handles the source
type passed in locked_opts
Checks if the gem is good to be a plugin
At present it only checks whether it contains plugins.rb file
@param [Pathname] plugin_path the path plugin is installed at @raise [MalformattedPlugin] if plugins.rb file is not found