From 76418b9fcd954647627eab24ca850ae52db5150a Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Wed, 28 Mar 2018 16:22:50 -0700 Subject: [PATCH] Simplify trigger selection --- lib/vagrant/plugin/v2/trigger.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/vagrant/plugin/v2/trigger.rb b/lib/vagrant/plugin/v2/trigger.rb index 639b1af8c..39644725d 100644 --- a/lib/vagrant/plugin/v2/trigger.rb +++ b/lib/vagrant/plugin/v2/trigger.rb @@ -30,9 +30,7 @@ module Vagrant # @param [String] guest_name The guest that invoked firing the triggers def fire_before_triggers(action, guest_name) # get all triggers matching action - triggers = config.before_triggers.select do |trigger| - trigger.command == action - end + triggers = config.before_triggers.select { |t| t.command == action } triggers = filter_triggers(triggers, guest_name) binding.pry @@ -49,10 +47,8 @@ module Vagrant # @param [Symbol] action Vagrant command to fire trigger on # @param [String] guest_name The guest that invoked firing the triggers def fire_after_triggers(action, guest_name) - triggers = [] - triggers = config.after_triggers.select do |trigger| - trigger.command == action - end + # get all triggers matching action + triggers = config.after_triggers.select { |t| t.command == action } triggers = filter_triggers(triggers, guest_name) binding.pry