Sha256: 6d38a70dd758bfa76da8d50d051f87e6e1f4208f154ea7daa128a691fad32a10
Contents?: true
Size: 723 Bytes
Versions: 16
Compression:
Stored size: 723 Bytes
Contents
module Capistrano class Configuration class Question def initialize(env, key, default) @env, @key, @default = env, key, default end def call ask_question save_response end private attr_reader :env, :key, :default def ask_question $stdout.puts question end def save_response env.set(key, value) end def value if response.empty? default else response end end def response @response ||= $stdin.gets.chomp end def question I18n.t(:question, key: key, default_value: default, scope: :capistrano) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems