Sha256: 0dd3a108067f3f2ef6412b8e0435fb6c680b410bb5be26c311f41ec2a848b170

Contents?: true

Size: 496 Bytes

Versions: 10

Compression:

Stored size: 496 Bytes

Contents

module Xcode
  module Shell
    def self.execute(bits, show_output=true)
      out = []
      cmd = bits.is_a?(Array) ? bits.join(' ') : bits
      
      puts "EXECUTE: #{cmd}"
      IO.popen (cmd) do |f| 
        f.each do |line|
          puts line if show_output
          out << line
        end 
      end
      #Process.wait
      raise "Error (#{$?.exitstatus}) executing '#{cmd}'\n\n  #{out.join("  ")}" if $?.exitstatus>0
      #puts "RETURN: #{out.inspect}"
      out
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
xcoder-0.0.17 lib/xcode/shell.rb
xcoder-0.0.16 lib/xcode/shell.rb
xcoder-0.0.15 lib/xcode/shell.rb
xcoder-0.0.14 lib/xcode/shell.rb
xcoder-0.0.12 lib/xcode/shell.rb
xcoder-0.0.11 lib/xcode/shell.rb
xcoder-0.0.10 lib/xcode/shell.rb
xcoder-0.0.9 lib/xcode/shell.rb
xcoder-0.0.8 lib/xcode/shell.rb
xcoder-0.0.7 lib/xcode/shell.rb