"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/vagrant/action/builder.rb" between
vagrant-2.2.13.tar.gz and vagrant-2.2.14.tar.gz

About: Vagrant provides the framework and configuration format to create and manage complete portable development environments. These development environments can live on your computer or in the cloud, and are portable between Windows, Mac OS X, and Linux.

builder.rb  (vagrant-2.2.13):builder.rb  (vagrant-2.2.14)
skipping to change at line 176 skipping to change at line 176
# Converts the builder stack to a runnable action sequence. # Converts the builder stack to a runnable action sequence.
# #
# @param [Hash] env The action environment hash # @param [Hash] env The action environment hash
# @return [Warden] A callable object # @return [Warden] A callable object
def to_app(env) def to_app(env)
# Start with a duplicate of ourself which can # Start with a duplicate of ourself which can
# be modified # be modified
builder = self.dup builder = self.dup
if env[:builder_applied] != env[:action_name]
apply_action_name = true
env[:builder_applied] = env[:action_name]
end
# Apply all dynamic modifications of the stack. This # Apply all dynamic modifications of the stack. This
# will generate dynamic hooks for all actions within # will generate dynamic hooks for all actions within
# the stack, load any triggers for action classes, and # the stack, load any triggers for action classes, and
# apply them to the builder's stack # apply them to the builder's stack
builder.apply_dynamic_updates(env) builder.apply_dynamic_updates(env)
if apply_action_name # Now that the stack is fully expanded, apply any
# Now that the stack is fully expanded, apply any # action hooks that may be defined so they are on
# action hooks that may be defined so they are on # the outermost locations of the stack
# the outermost locations of the stack builder.apply_action_name(env)
builder.apply_action_name(env)
end
# Wrap the middleware stack with the Warden to provide a consistent # Wrap the middleware stack with the Warden to provide a consistent
# and predictable behavior upon exceptions. # and predictable behavior upon exceptions.
Warden.new(builder.stack.dup, env) Warden.new(builder.stack.dup, env)
end end
# Find any action hooks or triggers which have been defined # Find any action hooks or triggers which have been defined
# for items within the stack. Update the stack with any # for items within the stack. Update the stack with any
# hooks or triggers found. # hooks or triggers found.
# #
skipping to change at line 268 skipping to change at line 261
# If action hooks have not already been set, this method # If action hooks have not already been set, this method
# will perform three tasks: # will perform three tasks:
# 1. Load any hook triggers defined for the action_name # 1. Load any hook triggers defined for the action_name
# 2. Load any action_hooks defined from plugins # 2. Load any action_hooks defined from plugins
# 3. Load any action triggers based on machine action called (not action classes) # 3. Load any action triggers based on machine action called (not action classes)
# #
# @param [Hash] env Call environment # @param [Hash] env Call environment
# @return [Builder] # @return [Builder]
def apply_action_name(env) def apply_action_name(env)
env[:builder_raw_applied] ||= []
return self if !env[:action_name] return self if !env[:action_name]
hook = Hook.new hook = Hook.new
machine_name = env[:machine].name if env[:machine] machine_name = env[:machine].name if env[:machine]
# Start with loading any hook triggers if applicable # Start with loading any hook triggers if applicable
if Vagrant::Util::Experimental.feature_enabled?("typed_triggers") && env [:triggers] if Vagrant::Util::Experimental.feature_enabled?("typed_triggers") && env [:triggers]
if !env[:triggers].find(env[:action_name], :before, machine_name, :hoo k).empty? if !env[:triggers].find(env[:action_name], :before, machine_name, :hoo k).empty?
hook.prepend(Vagrant::Action::Builtin::Trigger, hook.prepend(Vagrant::Action::Builtin::Trigger,
env[:action_name], env[:triggers], :before, :hook) env[:action_name], env[:triggers], :before, :hook)
skipping to change at line 296 skipping to change at line 290
# have defined # have defined
action_hooks = Vagrant.plugin("2").manager.action_hooks(env[:action_name ]) action_hooks = Vagrant.plugin("2").manager.action_hooks(env[:action_name ])
action_hooks.each do |hook_proc| action_hooks.each do |hook_proc|
hook_proc.call(hook) hook_proc.call(hook)
end end
# Finally load any action triggers defined. The action triggers # Finally load any action triggers defined. The action triggers
# are the originally implemented trigger style. They run before # are the originally implemented trigger style. They run before
# and after specific provider actions (like :up, :halt, etc) and # and after specific provider actions (like :up, :halt, etc) and
# are different from true action triggers # are different from true action triggers
if env[:triggers] if env[:triggers] && !env[:builder_raw_applied].include?(env[:raw_action
_name])
env[:builder_raw_applied] << env[:raw_action_name]
if !env[:triggers].find(env[:raw_action_name], :before, machine_name, :action, all: true).empty? if !env[:triggers].find(env[:raw_action_name], :before, machine_name, :action, all: true).empty?
hook.prepend(Vagrant::Action::Builtin::Trigger, hook.prepend(Vagrant::Action::Builtin::Trigger,
env[:raw_action_name], env[:triggers], :before, :action, all: true ) env[:raw_action_name], env[:triggers], :before, :action, all: true )
end end
if !env[:triggers].find(env[:raw_action_name], :after, machine_name, : action, all: true).empty? if !env[:triggers].find(env[:raw_action_name], :after, machine_name, : action, all: true).empty?
# NOTE: These after triggers need to be delayed before running to # NOTE: These after triggers need to be delayed before running to
# allow the rest of the call stack to complete before being # allow the rest of the call stack to complete before being
# run. The delayed action is prepended to the stack (not appen ded) # run. The delayed action is prepended to the stack (not appen ded)
# to ensure it is called first, which results in it properly # to ensure it is called first, which results in it properly
# waiting for everything to finish before itself completing. # waiting for everything to finish before itself completing.
 End of changes. 4 change blocks. 
12 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)