Skip to content

Commit

Permalink
Parameter :text added to ask() to override I18n prefix.
Browse files Browse the repository at this point in the history
Extend options to include a text variable to override the i18n question
prefix.
  • Loading branch information
simon-soak committed Aug 11, 2016
1 parent 4e68031 commit 11ec1b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Reverse Chronological Order:
https://github.com/capistrano/capistrano/compare/v3.6.0...HEAD

* Fix `NoMethodError: undefined method gsub` when setting `:application` to a Proc, for real this time! The original fix released in 3.6.0 worked for values specified with blocks, but not for those specified with procs or lambdas (the latter syntax is much more common). [#1681](https://github.com/capistrano/capistrano/issues/1681)
* Parameter `:text` added to `ask()` to override I18n question prefix e.g. `ask(:response, 'default_value', {text: 'Ask your question here (default_value): '})`
* Your contribution here!
* Replace spaces with dashes when computing the git-ssh suffix. (@will_in_wi)

Expand Down
2 changes: 2 additions & 0 deletions lib/capistrano/configuration/question.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def gets
end

def question
custom_text = (options || {})[:text]
return custom_text if custom_text
I18n.t(:question, key: key, default_value: default, scope: :capistrano)
end

Expand Down

0 comments on commit 11ec1b6

Please sign in to comment.