Sha256: 538ebc3646814ab4012f7973acf2dc10d060d8df1fc6d848dfe98fce16678413

Contents?: true

Size: 502 Bytes

Versions: 5

Compression:

Stored size: 502 Bytes

Contents

# coding: utf-8
# Helpers for root Rakefile

require 'pty'

ROOT = File.expand_path(File.join('..', '..'), __FILE__)

# run +cmd+ in subprocess, redirect its stdout to parent's stdout
def spawn(cmd)
  puts ">> #{cmd}"

  cmd += ' 2>&1'
  PTY.spawn cmd do |r, w, pid|
    begin
      r.sync
      r.each_char { |chr| STDOUT.write(chr) }
    rescue Errno::EIO => e
      # simply ignoring this
    ensure
      ::Process.wait pid
    end
  end
  abort "#{cmd} failed" unless $? && $?.exitstatus == 0
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
redis_counters-1.5.2 tasks/support.rb
redis_counters-1.5.1 tasks/support.rb
redis_counters-1.5.0 tasks/support.rb
redis_counters-1.4.0 tasks/support.rb
redis_counters-1.3.0 tasks/support.rb