Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanRada committed Jul 2, 2015
2 parents 694c2ad + 416e750 commit 3d9166f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/capistrano_multiconfig_parallel/initializers/helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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

0 comments on commit 3d9166f

Please sign in to comment.