Sha256: 2ce211d7f9ad47f721a164215215e9f5126d8bc16e8b74aa6799591d25f64a42

Contents?: true

Size: 602 Bytes

Versions: 26

Compression:

Stored size: 602 Bytes

Contents

require 'open3'

module Gitlab
  module Git
    module Popen
      def popen(cmd, path)
      unless cmd.is_a?(Array)
        raise "System commands must be given as an array of strings"
      end

        vars = { "PWD" => path }
        options = { :chdir => path }

        @cmd_output = ""
        @cmd_status = 0
        Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|
          @cmd_output << stdout.read
          @cmd_output << stderr.read
          @cmd_status = wait_thr.value.exitstatus
        end

        return @cmd_output, @cmd_status
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
gitlab_git-7.0.1 lib/gitlab_git/popen.rb
gitlab_git-7.0.0 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc15 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc14 lib/gitlab_git/popen.rb
gitlab_git-6.2.2 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc13 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc12 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc11 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc10 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc9 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc8 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc7 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc6 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc5 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc4 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc3 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc2 lib/gitlab_git/popen.rb
gitlab_git-7.0.0.rc1 lib/gitlab_git/popen.rb
gitlab_git-6.3.0 lib/gitlab_git/popen.rb
gitlab_git-6.2.1 lib/gitlab_git/popen.rb