Sha256: 802ff4c767741efea8113fff078f009fe292103438b7a72a1473c9446e9d5d57

Contents?: true

Size: 674 Bytes

Versions: 1

Compression:

Stored size: 674 Bytes

Contents

module CapistranoMulticonfigParallel
  class OutputStream
    def self.hook(actor)
      $stdout = new($stdout, actor)
    end

    def self.unhook
      $stdout.finish if $stdout.is_a? CapistranoMulticonfigParallel::OutputStream
      $stdout = STDOUT
    end

    attr_accessor :real, :actor, :strings

    def initialize(real_stdout, actor)
      self.real= real_stdout
      self.actor = actor
      self.strings = []
    end

    def write(*args)
      @real.write(*args) 
      @real.flush
      @actor.user_prompt_needed?(args.join(' ')) 
    end




   def finish

   end

   def method_missing(name, *args, &block)
    @real.send name, *args, &block
  end
end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano_multiconfig_parallel-0.9.0 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb