install(names, options)
public
Installs a new plugin by the given name
@param [Array] names the name of plugin
to be installed @param [Hash] options various
parameters as described in description.
Refer to cli/plugin for available options
# File lib/bundler/plugin.rb, line 37
def install(names, options)
specs = Installer.new.install(names, options)
save_plugins names, specs
rescue PluginError => e
if specs
specs_to_delete = Hash[specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }]
specs_to_delete.values.each {|spec| Bundler.rm_rf(spec.full_gem_path) }
end
Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}"
end