From b5637da6c4c9237192fe2a7534435350b1fd2a8e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 3 Mar 2014 14:55:34 -0800 Subject: [PATCH] core: plugin manager marks system gems as system --- lib/vagrant/plugin/manager.rb | 8 +++++++- test/unit/vagrant/plugin/manager_test.rb | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/plugin/manager.rb b/lib/vagrant/plugin/manager.rb index 8023fbea3..456e7c6ee 100644 --- a/lib/vagrant/plugin/manager.rb +++ b/lib/vagrant/plugin/manager.rb @@ -114,7 +114,13 @@ module Vagrant # # @return [Hash] def installed_plugins - system = @system_file ? @system_file.installed_plugins : {} + system = {} + if @system_file + @system_file.installed_plugins.each do |k, v| + system[k] = v.merge("system" => true) + end + end + system.merge(@user_file.installed_plugins) end diff --git a/test/unit/vagrant/plugin/manager_test.rb b/test/unit/vagrant/plugin/manager_test.rb index 104466e25..d9f38d0e1 100644 --- a/test/unit/vagrant/plugin/manager_test.rb +++ b/test/unit/vagrant/plugin/manager_test.rb @@ -214,7 +214,9 @@ describe Vagrant::Plugin::Manager do expect(plugins.length).to eql(2) expect(plugins).to have_key("foo") expect(plugins["foo"]["gem_version"]).to eq("0.1.0") + expect(plugins["foo"]["system"]).to be_false expect(plugins).to have_key("bar") + expect(plugins["bar"]["system"]).to be_true end end end