From b909adde1c6a674f72d5fe98f9c05e5e109da783 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 21 Sep 2010 18:14:18 -0600 Subject: [PATCH] Since I18n isn't automatic for UI class, get rid of _ prefix on options --- bin/vagrant | 2 +- lib/vagrant/command/box.rb | 4 ++-- lib/vagrant/command/ssh_config.rb | 2 +- lib/vagrant/command/status.rb | 2 +- lib/vagrant/command/upgrade_to_060.rb | 14 +++++++------- lib/vagrant/command/version.rb | 2 +- lib/vagrant/ui.rb | 6 +++--- test/vagrant/ui_test.rb | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/bin/vagrant b/bin/vagrant index 9b983c7f323..d7e35fe2438 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -14,7 +14,7 @@ begin # Kick start the CLI Vagrant::CLI.start(ARGV, :env => env) rescue Vagrant::Errors::VagrantError => e - opts = { :_prefix => false } + opts = { :prefix => false } env.ui.error e.message, opts if e.message env.ui.error e.backtrace.join("\n"), opts if ENV["VAGRANT_DEBUG"] exit e.status_code if e.respond_to?(:status_code) diff --git a/lib/vagrant/command/box.rb b/lib/vagrant/command/box.rb index 8df80f52afe..00218774dd3 100644 --- a/lib/vagrant/command/box.rb +++ b/lib/vagrant/command/box.rb @@ -25,8 +25,8 @@ def repackage(name) desc "list", "Lists all installed boxes" def list boxes = env.boxes.sort - return env.ui.warn(I18n.t("vagrant.commands.box.no_installed_boxes"), :_prefix => false) if boxes.empty? - boxes.each { |b| env.ui.info(b.name, :_prefix => false) } + return env.ui.warn(I18n.t("vagrant.commands.box.no_installed_boxes"), :prefix => false) if boxes.empty? + boxes.each { |b| env.ui.info(b.name, :prefix => false) } end end end diff --git a/lib/vagrant/command/ssh_config.rb b/lib/vagrant/command/ssh_config.rb index 92d70bd67c5..0feb4f562fa 100644 --- a/lib/vagrant/command/ssh_config.rb +++ b/lib/vagrant/command/ssh_config.rb @@ -14,7 +14,7 @@ def execute :ssh_user => vm.env.config.ssh.username, :ssh_port => vm.ssh.port, :private_key_path => vm.env.config.ssh.private_key_path - }), :_prefix => false) + }), :prefix => false) end end end diff --git a/lib/vagrant/command/status.rb b/lib/vagrant/command/status.rb index c4325cb73cb..b53359acba5 100644 --- a/lib/vagrant/command/status.rb +++ b/lib/vagrant/command/status.rb @@ -16,7 +16,7 @@ def route env.ui.info(I18n.t("vagrant.commands.status.output", :states => results.join("\n"), :message => I18n.t("vagrant.commands.status.#{state}")), - :_prefix => false) + :prefix => false) end end end diff --git a/lib/vagrant/command/upgrade_to_060.rb b/lib/vagrant/command/upgrade_to_060.rb index 3820e7a4ca1..4b811f28d1d 100644 --- a/lib/vagrant/command/upgrade_to_060.rb +++ b/lib/vagrant/command/upgrade_to_060.rb @@ -6,22 +6,22 @@ class UpgradeTo060Command < Base register "upgrade_to_060", "Upgrade pre-0.6.0 environment to 0.6.0", :hide => true def execute - @env.ui.warn I18n.t("vagrant.commands.upgrade_to_060.info"), :_prefix => false - @env.ui.warn "", :_prefix => false - if !@env.ui.yes? I18n.t("vagrant.commands.upgrade_to_060.ask"), :_prefix => false, :_color => :yellow - @env.ui.info I18n.t("vagrant.commands.upgrade_to_060.quit"), :_prefix => false + @env.ui.warn I18n.t("vagrant.commands.upgrade_to_060.info"), :prefix => false + @env.ui.warn "", :prefix => false + if !@env.ui.yes? I18n.t("vagrant.commands.upgrade_to_060.ask"), :prefix => false, :color => :yellow + @env.ui.info I18n.t("vagrant.commands.upgrade_to_060.quit"), :prefix => false return end local_data = @env.local_data if !local_data.empty? if local_data[:active] - @env.ui.confirm I18n.t("vagrant.commands.upgrade_to_060.already_done"), :_prefix => false + @env.ui.confirm I18n.t("vagrant.commands.upgrade_to_060.already_done"), :prefix => false return end # Backup the previous file - @env.ui.info I18n.t("vagrant.commands.upgrade_to_060.backing_up"), :_prefix => false + @env.ui.info I18n.t("vagrant.commands.upgrade_to_060.backing_up"), :prefix => false FileUtils.cp(local_data.file_path, "#{local_data.file_path}.bak-#{Time.now.to_i}") # Gather the previously set virtual machines into a single @@ -38,7 +38,7 @@ def execute local_data.commit end - @env.ui.confirm I18n.t("vagrant.commands.upgrade_to_060.complete"), :_prefix => false + @env.ui.confirm I18n.t("vagrant.commands.upgrade_to_060.complete"), :prefix => false end end end diff --git a/lib/vagrant/command/version.rb b/lib/vagrant/command/version.rb index 53b312e13a8..51a956faa3f 100644 --- a/lib/vagrant/command/version.rb +++ b/lib/vagrant/command/version.rb @@ -6,7 +6,7 @@ class VersionCommand < Base def version env.ui.info(I18n.t("vagrant.commands.version.output", :version => Vagrant::VERSION), - :_prefix => false) + :prefix => false) end end end diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb index 393c2b2aee8..946e534ea02 100644 --- a/lib/vagrant/ui.rb +++ b/lib/vagrant/ui.rb @@ -34,7 +34,7 @@ def initialize(env, shell) [:ask, :no?, :yes?].each do |method| define_method(method) do |message, opts=nil| opts ||= {} - @shell.send(method, format_message(message, opts), opts[:_color]) + @shell.send(method, format_message(message, opts), opts[:color]) end end @@ -50,8 +50,8 @@ def report_progress(progress, total, show_parts=true) protected def format_message(message, opts=nil) - opts = { :_prefix => true }.merge(opts || {}) - message = "[#{env.resource}] #{message}" if opts[:_prefix] + opts = { :prefix => true }.merge(opts || {}) + message = "[#{env.resource}] #{message}" if opts[:prefix] message end diff --git a/test/vagrant/ui_test.rb b/test/vagrant/ui_test.rb index cdd1fba7d3b..2f35abb3236 100644 --- a/test/vagrant/ui_test.rb +++ b/test/vagrant/ui_test.rb @@ -23,7 +23,7 @@ class ShellUITest < Test::Unit::TestCase true end - @instance.info("vagrant.errors.test_key", :_prefix => false) + @instance.info("vagrant.errors.test_key", :prefix => false) end end end