Permalink
Browse files

prompt_with_default can now take a block, as Capistrano::CLI.ui.ask can.

It allows cool things like prompt_with_default(:really_delete_everything,"no") {|q| q.validate = /^(yes|no|)$/ }
  • Loading branch information...
arlo committed Jun 16, 2010
1 parent 0e4d6be commit 6ef32158ec7ca72d8696d6f088c2b758e66039b3
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/capifony.rb
View
@@ -21,9 +21,9 @@
# Symfony lib path
set(:symfony_lib) { guess_symfony_lib }
-def prompt_with_default(var, default)
+def prompt_with_default(var, default, &block)
set(var) do
- Capistrano::CLI.ui.ask "#{var} [#{default}] : "
+ Capistrano::CLI.ui.ask("#{var} [#{default}] : ", &block)
end
set var, default if eval("#{var.to_s}.empty?")
end

0 comments on commit 6ef3215

Please sign in to comment.