From 34ec385c8119b89ade5c9b26efb49b4359b0b9f7 Mon Sep 17 00:00:00 2001 From: Alex Rodionov Date: Wed, 7 May 2014 19:02:21 +0700 Subject: [PATCH] core: public_send vs send when merging configs This fixes the problem when config keys collide with Kernel/Object methods (private). An example is `exec` which is used in vagrant-exec plugin. Compare: > old.send :exec ArgumentError: wrong number of arguments (0 for 1+) > old.public_send :exec => # --- lib/vagrant/config/v2/loader.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/config/v2/loader.rb b/lib/vagrant/config/v2/loader.rb index 1fd87c069..ac7c34d05 100644 --- a/lib/vagrant/config/v2/loader.rb +++ b/lib/vagrant/config/v2/loader.rb @@ -55,10 +55,10 @@ module Vagrant # merge every key. This avoids issues with the same reference # being part of the config. old_state["config_map"].each do |k, _| - old.send(k) + old.public_send(k) end new_state["config_map"].each do |k, _| - new.send(k) + new.public_send(k) end # The config map for the new object is the old one merged with the