Move StateFile into Vagrant::Plugin core
This commit is contained in:
parent
d98868d150
commit
8450f20e87
|
@ -2,5 +2,6 @@ module Vagrant
|
||||||
module Plugin
|
module Plugin
|
||||||
autoload :V1, "vagrant/plugin/v1"
|
autoload :V1, "vagrant/plugin/v1"
|
||||||
autoload :V2, "vagrant/plugin/v2"
|
autoload :V2, "vagrant/plugin/v2"
|
||||||
|
autoload :StateFile, "vagrant/plugin/state_file"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require "json"
|
require "json"
|
||||||
|
|
||||||
module VagrantPlugins
|
module Vagrant
|
||||||
module CommandPlugin
|
module Plugin
|
||||||
# This is a helper to deal with the plugin state file that Vagrant
|
# This is a helper to deal with the plugin state file that Vagrant
|
||||||
# uses to track what plugins are installed and activated and such.
|
# uses to track what plugins are installed and activated and such.
|
||||||
class StateFile
|
class StateFile
|
|
@ -1,3 +1,5 @@
|
||||||
|
require "vagrant/plugin/state_file"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandPlugin
|
module CommandPlugin
|
||||||
module Command
|
module Command
|
||||||
|
@ -11,7 +13,7 @@ module VagrantPlugins
|
||||||
def action(callable, env=nil)
|
def action(callable, env=nil)
|
||||||
env = {
|
env = {
|
||||||
:gem_helper => GemHelper.new(@env.gems_path),
|
:gem_helper => GemHelper.new(@env.gems_path),
|
||||||
:plugin_state_file => StateFile.new(@env.home_path.join("plugins.json"))
|
:plugin_state_file => Vagrant::Plugin::StateFile.new(@env.home_path.join("plugins.json"))
|
||||||
}.merge(env || {})
|
}.merge(env || {})
|
||||||
|
|
||||||
@env.action_runner.run(callable, env)
|
@env.action_runner.run(callable, env)
|
||||||
|
|
|
@ -17,6 +17,5 @@ DESC
|
||||||
|
|
||||||
autoload :Action, File.expand_path("../action", __FILE__)
|
autoload :Action, File.expand_path("../action", __FILE__)
|
||||||
autoload :GemHelper, File.expand_path("../gem_helper", __FILE__)
|
autoload :GemHelper, File.expand_path("../gem_helper", __FILE__)
|
||||||
autoload :StateFile, File.expand_path("../state_file", __FILE__)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
require "json"
|
require "json"
|
||||||
require "pathname"
|
require "pathname"
|
||||||
|
|
||||||
require File.expand_path("../../../../base", __FILE__)
|
require File.expand_path("../../../base", __FILE__)
|
||||||
|
|
||||||
describe VagrantPlugins::CommandPlugin::StateFile do
|
describe Vagrant::Plugin::StateFile do
|
||||||
let(:path) do
|
let(:path) do
|
||||||
f = Tempfile.new("vagrant")
|
f = Tempfile.new("vagrant")
|
||||||
p = f.path
|
p = f.path
|
Loading…
Reference in New Issue