Fix `vagrant plugin` commands

`StateFile#installed_plugins` returns now a Hash instead of Array.

Fixes regression from 39b2539.
This commit is contained in:
Teemu Matilainen 2013-12-04 18:23:03 -03:00
parent ee8f962537
commit 294f4def91
5 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@ module VagrantPlugins
def call(env) def call(env)
# Get the list of installed plugins according to the state file # Get the list of installed plugins according to the state file
installed = Set.new(env[:plugin_state_file].installed_plugins) installed = env[:plugin_state_file].installed_plugins.keys
# If the plugin we're trying to license doesn't exist in the # If the plugin we're trying to license doesn't exist in the
# state file, then it is an error. # state file, then it is an error.

View File

@ -18,7 +18,7 @@ module VagrantPlugins
def call(env) def call(env)
# Get the list of installed plugins according to the state file # Get the list of installed plugins according to the state file
installed = Set.new(env[:plugin_state_file].installed_plugins) installed = env[:plugin_state_file].installed_plugins.keys
# Go through the plugins installed in this environment and # Go through the plugins installed in this environment and
# get the latest version of each. # get the latest version of each.

View File

@ -12,7 +12,7 @@ module VagrantPlugins
def call(env) def call(env)
# Get the list of installed plugins according to the state file # Get the list of installed plugins according to the state file
installed = Set.new(env[:plugin_state_file].installed_plugins) installed = env[:plugin_state_file].installed_plugins.keys
if !installed.include?(env[:plugin_name]) if !installed.include?(env[:plugin_name])
raise Vagrant::Errors::PluginNotInstalled, raise Vagrant::Errors::PluginNotInstalled,
name: env[:plugin_name] name: env[:plugin_name]

View File

@ -34,7 +34,7 @@ module VagrantPlugins
@logger.info("Pruning gems...") @logger.info("Pruning gems...")
# Get the list of installed plugins according to the state file # Get the list of installed plugins according to the state file
installed = Set.new(env[:plugin_state_file].installed_plugins) installed = env[:plugin_state_file].installed_plugins.keys
# Get the actual specifications of installed gems # Get the actual specifications of installed gems
all_specs = env[:gem_helper].with_environment do all_specs = env[:gem_helper].with_environment do

View File

@ -32,11 +32,11 @@ module VagrantPlugins
save! save!
end end
# This returns a list of installed plugins according to the state # This returns a hash of installed plugins according to the state
# file. Note that this may _not_ directly match over to actually # file. Note that this may _not_ directly match over to actually
# installed gems. # installed gems.
# #
# @return [Array<String>] # @return [Hash]
def installed_plugins def installed_plugins
@data["installed"] @data["installed"]
end end