Sha256: 21d26eff69cfbf63e70af7eebc0404378970e455c9bdec293b107c8dbd571151
Contents?: true
Size: 726 Bytes
Versions: 21
Compression:
Stored size: 726 Bytes
Contents
module CapistranoSentinel # class used to hook into the input stream class InputStream def self.hook(actor, stringio) $stdin = new($stdin, actor, stringio) end def self.unhook $stdin.finish if $stdin.is_a? CapistranoSentinel::InputStream $stdin = STDIN end attr_accessor :real, :actor, :stringio def initialize(real_stdin, actor, stringio) self.real = real_stdin self.actor = actor self.stringio = stringio end def gets(*_args) @stringio.rewind data = @stringio.read @actor.user_prompt_needed?(data) end def finish end def method_missing(name, *args, &block) @real.send name, *args, &block end end end
Version data entries
21 entries across 21 versions & 1 rubygems