Sha256: 92172f0b82b8285d2ad07d932a48b20b3ca8618cf0ca2edd06e2e715cc2934f2

Contents?: true

Size: 284 Bytes

Versions: 36

Compression:

Stored size: 284 Bytes

Contents

module Util
  def self.prompt(msg, prompt = "(y)es, (n)o ")
    answer = Capistrano::CLI.ui.ask("#{msg} #{prompt} ? ") do |q|
      q.overwrite = false
      q.validate = /^y$|^yes$|^n$|^no$/i
      q.responses[:not_valid] = prompt
    end
    (answer =~ /^y$|^yes$/i) == 0
  end
end

Version data entries

36 entries across 36 versions & 3 rubygems

Version Path
capistrano-db-tasks-0.2 lib/capistrano-db-tasks/util.rb
caploy-0.1.5 lib/util.rb
caploy-0.1.4 lib/util.rb
caploy-0.1.3 lib/util.rb
caploy-0.1.2 lib/util.rb
caploy-0.1.1 lib/util.rb
caploy-0.1.0 lib/util.rb
ms_deploy-0.3.6 lib/util.rb
ms_deploy-0.3.5 lib/util.rb
ms_deploy-0.3.4 lib/util.rb
ms_deploy-0.3.3 lib/util.rb
ms_deploy-0.3.2 lib/util.rb
ms_deploy-0.3.1 lib/util.rb
ms_deploy-0.3.0 lib/util.rb
ms_deploy-0.2.5 lib/util.rb
ms_deploy-0.2.4 lib/util.rb