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-0.18.0 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.17.0 lib/capistrano_multiconfig_parallel/classes/output_stream.rb
capistrano_multiconfig_parallel-0.16.2 lib/capistrano_multiconfig_parallel/helpers/output_stream.rb
capistrano_multiconfig_parallel-0.16.1 lib/capistrano_multiconfig_parallel/helpers/output_stream.rb
capistrano_multiconfig_parallel-0.16.0 lib/capistrano_multiconfig_parallel/helpers/output_stream.rb
capistrano_multiconfig_parallel-0.15.6 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.15.5 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.15.4 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.15.3 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.15.2 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.15.1 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.15.0 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.14.0 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.13.2 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.13.1 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.13.0 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.12.9 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.12.8 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
capistrano_multiconfig_parallel-0.12.7 lib/capistrano_multiconfig_parallel/extensions/output_stream.rb