Sha256: 1a082736ab4abe06b2d281e33e1448b0c9943350e04926d7c53b8f2b6ebb4137

Contents?: true

Size: 710 Bytes

Versions: 13

Compression:

Stored size: 710 Bytes

Contents

module CapistranoMulticonfigParallel
  class InputStream
    def self.hook(actor, stringio)
      $stdin = new($stdin, actor, stringio)
    end

    def self.unhook
      $stdin.finish if $stdin.is_a? CapistranoMulticonfigParallel::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

13 entries across 13 versions & 1 rubygems

Version Path
capistrano_multiconfig_parallel-0.12.2 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb
capistrano_multiconfig_parallel-0.12.1 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb
capistrano_multiconfig_parallel-0.12.0 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb
capistrano_multiconfig_parallel-0.11.6 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb
capistrano_multiconfig_parallel-0.11.5 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb
capistrano_multiconfig_parallel-0.11.4 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb
capistrano_multiconfig_parallel-0.11.3 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb
capistrano_multiconfig_parallel-0.11.2 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb
capistrano_multiconfig_parallel-0.11.1 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb
capistrano_multiconfig_parallel-0.11.0 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb
capistrano_multiconfig_parallel-0.10.0 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb
capistrano_multiconfig_parallel-0.9.2 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb
capistrano_multiconfig_parallel-0.9.1 lib/capistrano_multiconfig_parallel/extensions/input_stream.rb