From 416e75021b02938fc6b375e0f3858f12b5e7e1f8 Mon Sep 17 00:00:00 2001 From: Rada Bogdan Raul Date: Thu, 2 Jul 2015 18:29:40 +0300 Subject: [PATCH] fix missing file --- .../initializers/helper.rb | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/capistrano_multiconfig_parallel/initializers/helper.rb diff --git a/lib/capistrano_multiconfig_parallel/initializers/helper.rb b/lib/capistrano_multiconfig_parallel/initializers/helper.rb new file mode 100644 index 0000000..564c09c --- /dev/null +++ b/lib/capistrano_multiconfig_parallel/initializers/helper.rb @@ -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