vendor/bundle/ruby/1.8/gems/io-reactor-1.0.4/rake/helpers.rb
### Open a pipe to a process running the given +cmd+ and call the given block with it.
Open a pipe to a process running the given +cmd+ and call the given block with it.
Open a pipe to a process running the given + cmd + and call the given block with it .
def pipeto( *cmd )
	$DEBUG = true
	cmd.flatten!
	log( "Opening a pipe to: ", cmd.collect {|part| part =~ /\s/ ? part.inspect : part} ) 
	if $dryrun
		$deferr.puts "(dry run mode)"
	else
		open( '|-', 'w+' ) do |io|
			if io
				yield( io )
			else
				exec( *cmd )
				fail "Command failed: [%s]" % [cmd.join(' ')]
			end
		end
	end
end
def pipeto ( * cmd ) $DEBUG = true cmd . flatten! log ( "Opening a pipe to: " , cmd . collect { | part | part =~ / \s / ? part . inspect : part } ) if $dryrun $deferr . puts "(dry run mode)" else open ( '|-' , 'w+' ) do | io | if io yield ( io ) else exec ( * cmd ) fail "Command failed: [%s]" % [ cmd . join ( ' ' ) ] end end end end
Open a pipe to a process running the given +cmd+ and call the given block with it.
Open a pipe to a process running the given + cmd + and call the given block with it .
# Parent # Child
cmd