Put plugins in their own Gemfile group so we can load on their own
This commit is contained in:
parent
e800743d06
commit
8cfa24143d
|
@ -39,6 +39,10 @@ if argv.include?("--debug")
|
|||
ENV["VAGRANT_LOG"] = "debug"
|
||||
end
|
||||
|
||||
# Setup our dependencies by initializing Bundler
|
||||
require "bundler"
|
||||
Bundler.setup
|
||||
|
||||
require 'log4r'
|
||||
require 'vagrant'
|
||||
require 'vagrant/cli'
|
||||
|
|
|
@ -261,4 +261,4 @@ Vagrant.source_root.join("plugins").children(true).each do |directory|
|
|||
end
|
||||
|
||||
# If we have plugins enabled, then load those
|
||||
Bundler.require(:default) if Vagrant.plugins_enabled?
|
||||
Bundler.require(:plugins) if Vagrant.plugins_enabled?
|
||||
|
|
|
@ -39,9 +39,8 @@ module Vagrant
|
|||
"#{Vagrant.user_data_path.join("gems")}#{::File::PATH_SEPARATOR}#{@gem_path}"
|
||||
Gem.clear_paths
|
||||
|
||||
# Load Bundler and setup our paths
|
||||
# Load Bundler now
|
||||
require "bundler"
|
||||
::Bundler.setup
|
||||
|
||||
# Do some additional Bundler initialization
|
||||
::Bundler.ui = ::Bundler::UI.new
|
||||
|
@ -70,7 +69,7 @@ module Vagrant
|
|||
|
||||
# Clean up any unused/old gems
|
||||
runtime = ::Bundler::Runtime.new(root, definition)
|
||||
runtime.clean
|
||||
#runtime.clean
|
||||
|
||||
definition.specs
|
||||
end
|
||||
|
@ -85,9 +84,11 @@ module Vagrant
|
|||
gemfile.puts(%Q[source "https://rubygems.org"])
|
||||
gemfile.puts(%Q[source "http://gems.hashicorp.com"])
|
||||
gemfile.puts(%Q[gem "vagrant", "= #{Vagrant::VERSION}"])
|
||||
gemfile.puts("group :plugins do")
|
||||
plugins.each do |plugin|
|
||||
gemfile.puts(%Q[gem "#{plugin}"])
|
||||
end
|
||||
gemfile.puts("end")
|
||||
gemfile.close
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,6 +25,7 @@ module Vagrant
|
|||
# Installs another plugin into our gem directory.
|
||||
#
|
||||
# @param [String] name Name of the plugin (gem)
|
||||
# @return [Gem::Specification]
|
||||
def install_plugin(name)
|
||||
result = nil
|
||||
Vagrant::Bundler.instance.install(installed_plugins.push(name)).each do |spec|
|
||||
|
@ -33,6 +34,9 @@ module Vagrant
|
|||
result = spec
|
||||
end
|
||||
|
||||
# Add the plugin to the state file
|
||||
@global_file.add_plugin(result.name)
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue