From ae17dc09ebc2ed050bacccb10094e547ff8fe8dc Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 4 Jan 2014 17:21:53 -0800 Subject: [PATCH] commands/plugin: list plugins uses Bundler --- .../commands/plugin/action/list_plugins.rb | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/plugins/commands/plugin/action/list_plugins.rb b/plugins/commands/plugin/action/list_plugins.rb index f5dd0574b..4abbcab99 100644 --- a/plugins/commands/plugin/action/list_plugins.rb +++ b/plugins/commands/plugin/action/list_plugins.rb @@ -1,4 +1,3 @@ -require "rubygems" require "set" module VagrantPlugins @@ -23,18 +22,16 @@ module VagrantPlugins # Go through the plugins installed in this environment and # get the latest version of each. installed_map = {} - env[:gem_helper].with_environment do - Gem::Specification.find_all.each do |spec| - # Ignore specs that aren't in our installed list - next if !installed.include?(spec.name) + Bundler.load.specs.each do |spec| + # Ignore specs that aren't in our installed list + next if !installed.include?(spec.name) - # If we already have a newer version in our list of installed, - # then ignore it - next if installed_map.has_key?(spec.name) && - installed_map[spec.name].version >= spec.version + # If we already have a newer version in our list of installed, + # then ignore it + next if installed_map.has_key?(spec.name) && + installed_map[spec.name].version >= spec.version - installed_map[spec.name] = spec - end + installed_map[spec.name] = spec end # Output!