Sha256: f9f2f21435ec5feda5f7b18ced08015e7ed854ebdef5da990e6646304b4becd5

Contents?: true

Size: 365 Bytes

Versions: 11

Compression:

Stored size: 365 Bytes

Contents

require 'open4'
module Bricks
  module Helper
    def run(cd, *args)
      status = 0
      msg    = nil
      err    = nil
      cd ||= '.'
      Dir.chdir(cd) do
        status = Open4::popen4(*args) do |pid, stdin, stdout, stderr|
          msg = stdout.read
          err = stderr.read
        end
      end
      return status == 0, msg, err
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
zena-1.2.8 lib/bricks/helper.rb
zena-1.2.7 lib/bricks/helper.rb
zena-1.2.6 lib/bricks/helper.rb
zena-1.2.5 lib/bricks/helper.rb
zena-1.2.4 lib/bricks/helper.rb
zena-1.2.3 lib/bricks/helper.rb
zena-1.2.2 lib/bricks/helper.rb
zena-1.2.1 lib/bricks/helper.rb
zena-1.2.0 lib/bricks/helper.rb
zena-1.1.3 lib/bricks/helper.rb
zena-1.1.2 lib/bricks/helper.rb