From 988518a6ba0deea79ead95a30dbcb33d27a00c5b Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Thu, 23 Oct 2014 16:06:25 -0400 Subject: [PATCH] Make Environment#pushes its own method --- lib/vagrant/environment.rb | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index f89c94773..106d0d9c5 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -545,21 +545,21 @@ module Vagrant def push(name=nil) @logger.info("Getting push: #{name}") - if vagrantfile.pushes.nil? || vagrantfile.pushes.empty? + if pushes.nil? || pushes.empty? raise Vagrant::Errors::PushesNotDefined end if name.nil? - if vagrantfile.pushes.length != 1 + if pushes.length != 1 raise Vagrant::Errors::PushStrategyNotProvided, - pushes: vagrantfile.pushes + pushes: pushes end - name = vagrantfile.pushes.first + name = pushes.first else - if !vagrantfile.pushes.include?(name.to_sym) + if !pushes.include?(name.to_sym) raise Vagrant::Errors::PushStrategyNotDefined, name: name, - pushes: vagrantfile.pushes + pushes: pushes end end @@ -584,6 +584,13 @@ module Vagrant end end + # The list of pushes defined in this Vagrantfile. + # + # @return [Array] + def pushes + vagrantfile.pushes + end + # This returns a machine with the proper provider for this environment. # The machine named by `name` must be in this environment. #