diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-28 19:22:45 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-28 19:22:45 +0400 |
commit | 1c5876eb7b2deb069d919bd19b51c9f6218e0f41 (patch) | |
tree | 0d93953103153bcadc96ee9688a1cca43a9711a0 /lib/gitlab/popen.rb | |
parent | b4f16faafd5bff1683996152b49342743a0f1a8b (diff) |
Do gitolite calls async. Remove satellite with project remove
Diffstat (limited to 'lib/gitlab/popen.rb')
-rw-r--r-- | lib/gitlab/popen.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/gitlab/popen.rb b/lib/gitlab/popen.rb new file mode 100644 index 00000000000..f2cfd8073e3 --- /dev/null +++ b/lib/gitlab/popen.rb @@ -0,0 +1,18 @@ +module Gitlab + module Popen + def popen(cmd, path) + vars = { "PWD" => path } + options = { :chdir => path } + + @cmd_output = "" + @cmd_status = 0 + Open3.popen3(vars, cmd, options) do |stdin, stdout, stderr, wait_thr| + @cmd_status = wait_thr.value.exitstatus + @cmd_output << stdout.read + @cmd_output << stderr.read + end + + return @cmd_output, @cmd_status + end + end +end |