From 408eee746d49b23595e0b1fadbb456e7f8d83b2f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 20 Mar 2013 22:30:31 -0700 Subject: [PATCH] Stylistic changes for GH-1461 --- plugins/commands/plugin/action/install_gem.rb | 6 +++--- plugins/commands/plugin/command/install.rb | 21 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/plugins/commands/plugin/action/install_gem.rb b/plugins/commands/plugin/action/install_gem.rb index 72bf078a9..7d1fe27c1 100644 --- a/plugins/commands/plugin/action/install_gem.rb +++ b/plugins/commands/plugin/action/install_gem.rb @@ -16,13 +16,13 @@ module VagrantPlugins def call(env) plugin_name = env[:plugin_name] - prerelease = env[:plugin_prerelease] - version = env[:plugin_version] + prerelease = env[:plugin_prerelease] + version = env[:plugin_version] # Install the gem plugin_name_label = plugin_name plugin_name_label += ' --prerelease' if prerelease - plugin_name_label += " --version \"#{version}\"" if version + plugin_name_label += " --version '#{version}'" if version env[:ui].info(I18n.t("vagrant.commands.plugin.installing", :name => plugin_name_label)) installed_gems = env[:gem_helper].with_environment do diff --git a/plugins/commands/plugin/command/install.rb b/plugins/commands/plugin/command/install.rb index 109343dbe..b240e2aa9 100644 --- a/plugins/commands/plugin/command/install.rb +++ b/plugins/commands/plugin/command/install.rb @@ -17,19 +17,22 @@ module VagrantPlugins "The name of the entry point file for loading the plugin.") do |entry_point| options[:entry_point] = entry_point end + o.on("--plugin-prerelease", - "Install a prereleased version of the plugin") do |plugin_prerelease| + "Allow prerelease versions of this plugin.") do |plugin_prerelease| options[:plugin_prerelease] = plugin_prerelease end + + o.on("--plugin-source PLUGIN_SOURCE", String, + "Add a RubyGems repository source") do |plugin_source| + options[:plugin_sources] ||= [] + options[:plugin_sources] << plugin_source + end + o.on("--plugin-version PLUGIN_VERSION", String, "Install a specific version of the plugin") do |plugin_version| options[:plugin_version] = plugin_version end - o.on("--plugin-source PLUGIN_SOURCE", String, - "Add a ruby gem repository") do |plugin_source| - options[:plugin_sources] = [] if !options[:plugin_sources] - options[:plugin_sources] << plugin_source - end end # Parse the options @@ -40,9 +43,9 @@ module VagrantPlugins # Install the gem action(Action.action_install, { :plugin_entry_point => options[:entry_point], - :plugin_prerelease => options[:plugin_prerelease], - :plugin_version => options[:plugin_version], - :plugin_sources => options[:plugin_sources], + :plugin_prerelease => options[:plugin_prerelease], + :plugin_version => options[:plugin_version], + :plugin_sources => options[:plugin_sources], :plugin_name => argv[0] })