Sha256: be1b1ed5b61ba746a34d5075c326cbdcd67ca7dccceb74e72218e824b4028f23

Contents?: true

Size: 541 Bytes

Versions: 13

Compression:

Stored size: 541 Bytes

Contents

module CapistranoMulticonfigParallel
  # class used to find application dependencies
  class Helper
    # rubocop:disable Lint/Eval
    def self.capture(stream)
      stream = stream.to_s
      captured_stream = Tempfile.new(stream)
      stream_io = eval("$#{stream}")
      origin_stream = stream_io.dup
      stream_io.reopen(captured_stream)

      yield

      stream_io.rewind
      return captured_stream.read
    ensure
      captured_stream.close
      captured_stream.unlink
      stream_io.reopen(origin_stream)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
capistrano_multiconfig_parallel-0.9.2 lib/capistrano_multiconfig_parallel/initializers/helper.rb
capistrano_multiconfig_parallel-0.9.1 lib/capistrano_multiconfig_parallel/initializers/helper.rb
capistrano_multiconfig_parallel-0.9.0 lib/capistrano_multiconfig_parallel/initializers/helper.rb
capistrano_multiconfig_parallel-0.8.3 lib/capistrano_multiconfig_parallel/initializers/helper.rb
capistrano_multiconfig_parallel-0.8.2 lib/capistrano_multiconfig_parallel/initializers/helper.rb
capistrano_multiconfig_parallel-0.8.1 lib/capistrano_multiconfig_parallel/initializers/helper.rb
capistrano_multiconfig_parallel-0.8.0 lib/capistrano_multiconfig_parallel/initializers/helper.rb
capistrano_multiconfig_parallel-0.7.7 lib/capistrano_multiconfig_parallel/initializers/helper.rb
capistrano_multiconfig_parallel-0.7.6 lib/capistrano_multiconfig_parallel/initializers/helper.rb
capistrano_multiconfig_parallel-0.7.3 lib/capistrano_multiconfig_parallel/initializers/helper.rb
capistrano_multiconfig_parallel-0.7.2 lib/capistrano_multiconfig_parallel/initializers/helper.rb
capistrano_multiconfig_parallel-0.7.1 lib/capistrano_multiconfig_parallel/initializers/helper.rb
capistrano_multiconfig_parallel-0.7.0 lib/capistrano_multiconfig_parallel/initializers/helper.rb