Add trigger config plugin

This commit is contained in:
Brian Cain 2018-03-08 14:20:21 -08:00
parent 3a84ae0ec4
commit a194057fc0
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,46 @@
require "vagrant"
module VagrantPlugins
module Kernel_V2
class TriggerConfig < Vagrant.plugin("2", :config)
attr_accessor :name
def initialize
@logger = Log4r::Logger.new("vagrant::config::trigger")
# Internal state
@name = UNSET_VALUE
end
# @param [Symbol] command Vagrant command to create trigger on
# @param [Block] block The defined after block
def before(command, &block)
end
# @param [Symbol] command Vagrant command to create trigger on
# @param [Block] block The defined after block
def after(command, &block)
end
#-------------------------------------------------------------------
# Internal methods, don't call these.
#-------------------------------------------------------------------
def finalize!
@name = nil if @name == UNSET_VALUE
end
# Validate all pushes
def validate(machine)
end
# The String representation of this Trigger.
#
# @return [String]
def to_s
"Trigger"
end
end
end
end

View File

@ -39,6 +39,11 @@ module VagrantPlugins
require File.expand_path("../config/vm", __FILE__)
VMConfig
end
config("trigger") do
require File.expand_path("../config/trigger", __FILE__)
TriggerConfig
end
end
end
end