commands/plugin: allow within Bundler env (cause we always are)
This commit is contained in:
parent
8adef9c15f
commit
5387984e0f
|
@ -8,7 +8,6 @@ module VagrantPlugins
|
|||
# This middleware sequence will install a plugin.
|
||||
def self.action_install
|
||||
Vagrant::Action::Builder.new.tap do |b|
|
||||
b.use BundlerCheck
|
||||
b.use InstallGem
|
||||
b.use PruneGems
|
||||
end
|
||||
|
@ -17,7 +16,6 @@ module VagrantPlugins
|
|||
# This middleware sequence licenses paid addons.
|
||||
def self.action_license
|
||||
Vagrant::Action::Builder.new.tap do |b|
|
||||
b.use BundlerCheck
|
||||
b.use LicensePlugin
|
||||
end
|
||||
end
|
||||
|
@ -25,7 +23,6 @@ module VagrantPlugins
|
|||
# This middleware sequence will list all installed plugins.
|
||||
def self.action_list
|
||||
Vagrant::Action::Builder.new.tap do |b|
|
||||
b.use BundlerCheck
|
||||
b.use ListPlugins
|
||||
end
|
||||
end
|
||||
|
@ -33,7 +30,6 @@ module VagrantPlugins
|
|||
# This middleware sequence will uninstall a plugin.
|
||||
def self.action_uninstall
|
||||
Vagrant::Action::Builder.new.tap do |b|
|
||||
b.use BundlerCheck
|
||||
b.use UninstallPlugin
|
||||
b.use PruneGems
|
||||
end
|
||||
|
@ -42,7 +38,6 @@ module VagrantPlugins
|
|||
# This middleware sequence will update a plugin.
|
||||
def self.action_update
|
||||
Vagrant::Action::Builder.new.tap do |b|
|
||||
b.use BundlerCheck
|
||||
b.use PluginExistsCheck
|
||||
b.use InstallGem
|
||||
b.use PruneGems
|
||||
|
@ -51,7 +46,6 @@ module VagrantPlugins
|
|||
|
||||
# The autoload farm
|
||||
action_root = Pathname.new(File.expand_path("../action", __FILE__))
|
||||
autoload :BundlerCheck, action_root.join("bundler_check")
|
||||
autoload :InstallGem, action_root.join("install_gem")
|
||||
autoload :LicensePlugin, action_root.join("license_plugin")
|
||||
autoload :ListPlugins, action_root.join("list_plugins")
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
module VagrantPlugins
|
||||
module CommandPlugin
|
||||
module Action
|
||||
class BundlerCheck
|
||||
def initialize(app, env)
|
||||
@app = app
|
||||
end
|
||||
|
||||
def call(env)
|
||||
# Bundler sets up its own custom gem load paths such that our
|
||||
# own gems are never loaded. Therefore, give an error if a user
|
||||
# tries to install gems while within a Bundler-managed environment.
|
||||
if defined?(Bundler)
|
||||
require 'bundler/shared_helpers'
|
||||
if Bundler::SharedHelpers.in_bundle?
|
||||
raise Vagrant::Errors::GemCommandInBundler
|
||||
end
|
||||
end
|
||||
|
||||
@app.call(env)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue