From 14d58021a740c21dbc625d3e5e6d0a7c61d737ce Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Wed, 16 Apr 2014 02:11:10 +0400 Subject: [PATCH] Changed i18n - fixed double `starting` key - changed asking question to more standard format (like common unix commandline tools) - removing dirty double quotes --- CHANGELOG.md | 1 + lib/capistrano/configuration/question.rb | 2 +- lib/capistrano/i18n.rb | 5 ++--- spec/integration/dsl_spec.rb | 2 +- spec/lib/capistrano/configuration/question_spec.rb | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb6265c7..a2b1e891 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Reverse Chronological Order: https://github.com/capistrano/capistrano/compare/v3.2.0...HEAD * Minor changes: + * Changed asking question to more standard format (like common unix commandline tools) (@sponomarev) * Fixed typos in the README. (@sponomarev) * Added `keys` method to Configuration to allow introspection of configuration options. (@juanibiapina) diff --git a/lib/capistrano/configuration/question.rb b/lib/capistrano/configuration/question.rb index 27da09f3..ffd99605 100644 --- a/lib/capistrano/configuration/question.rb +++ b/lib/capistrano/configuration/question.rb @@ -15,7 +15,7 @@ module Capistrano attr_reader :env, :key, :default def ask_question - $stdout.puts question + $stdout.print question end def save_response diff --git a/lib/capistrano/i18n.rb b/lib/capistrano/i18n.rb index c6534421..9d6e0685 100644 --- a/lib/capistrano/i18n.rb +++ b/lib/capistrano/i18n.rb @@ -3,7 +3,6 @@ require 'i18n' en = { starting: 'Starting', capified: 'Capified', - starting: 'Starting', start: 'Start', update: 'Update', finalize: 'Finalise', @@ -11,12 +10,12 @@ en = { finished: 'Finished', stage_not_set: 'Stage not set, please call something such as `cap production deploy`, where production is a stage you have defined.', written_file: 'create %{file}', - question: 'Please enter %{key}: |%{default_value}|', + question: 'Please enter %{key} (%{default_value}): ', keeping_releases: 'Keeping %{keep_releases} of %{releases} deployed releases on %{host}', no_old_releases: 'No old releases (keeping newest %{keep_releases}) on %{host}', linked_file_does_not_exist: 'linked file %{file} does not exist on %{host}', cannot_rollback: 'There are no older releases to rollback to', - mirror_exists: "The repository mirror is at %{at}", + mirror_exists: 'The repository mirror is at %{at}', revision_log_message: 'Branch %{branch} (at %{sha}) deployed as release %{release} by %{user}', rollback_log_message: '%{user} rolled back to release %{release}', deploy_failed: 'The deploy has failed with an error: %{ex}', diff --git a/spec/integration/dsl_spec.rb b/spec/integration/dsl_spec.rb index 68feb1b0..ee9dd629 100644 --- a/spec/integration/dsl_spec.rb +++ b/spec/integration/dsl_spec.rb @@ -283,7 +283,7 @@ describe Capistrano::DSL do describe 'asking for a variable' do before do dsl.ask(:scm, :svn) - $stdout.stubs(:puts) + $stdout.stubs(:print) end context 'variable is provided' do diff --git a/spec/lib/capistrano/configuration/question_spec.rb b/spec/lib/capistrano/configuration/question_spec.rb index d129ab37..cf1220c5 100644 --- a/spec/lib/capistrano/configuration/question_spec.rb +++ b/spec/lib/capistrano/configuration/question_spec.rb @@ -23,7 +23,7 @@ module Capistrano let(:branch) { 'branch' } before do - $stdout.expects(:puts).with('Please enter branch: |default|') + $stdout.expects(:print).with('Please enter branch (default): ') $stdin.expects(:gets).returns(branch) end @@ -37,7 +37,7 @@ module Capistrano let(:branch) { default } before do - $stdout.expects(:puts).with('Please enter branch: |default|') + $stdout.expects(:print).with('Please enter branch (default): ') $stdin.expects(:gets).returns('') end