Sha256: afb00bebd8b24d9b92d802ce6413bcca4dd0eaf799277fe55797c9a13ac6030d
Contents?: true
Size: 574 Bytes
Versions: 37
Compression:
Stored size: 574 Bytes
Contents
# frozen_string_literal: true module Bolt class Plugin class Prompt def initialize(*_args); end def name 'prompt' end def hooks %i[resolve_reference validate_resolve_reference] end def validate_resolve_reference(opts) raise Bolt::ValidationError, "Prompt requires a 'message'" unless opts['message'] end def resolve_reference(opts) $stderr.print("#{opts['message']}: ") value = $stdin.noecho(&:gets).to_s.chomp $stderr.puts value end end end end
Version data entries
37 entries across 37 versions & 1 rubygems