Sha256: c4a4cf026fe68c25f116506bfb53ff8b444578886dea9dd9f5a78a8b00625f29

Contents?: true

Size: 687 Bytes

Versions: 79

Compression:

Stored size: 687 Bytes

Contents

module CapistranoMulticonfigParallel
  # class used to hook into the output stream
  class OutputStream
    def self.hook(stringio)
      $stdout = new($stdout, stringio)
    end

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

    attr_accessor :real, :stringio

    def initialize(real_stdout, stringio)
      self.real = real_stdout
      self.stringio = stringio
    end

    def write(*args)
      @stringio.print(*args)
      @real.write(*args)
      @real.flush
    end

    def finish
    end

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

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
capistrano_multiconfig_parallel-1.0.2 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-1.0.1 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-1.0.0 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.32.0 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.31.1 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.31.0 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.30.6 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.30.5 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.30.4 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.30.3 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.30.2 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.30.1 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.30.0 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.29.3 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.29.2 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.29.1 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.29.0 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.28.5 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.28.4 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.28.3 lib/capistrano_multiconfig_parallel/classes/output_stream.rb