class Autorake::Builder
Attributes
quiet[RW]
verbose[RW]
Private Class Methods
tmpfiles(source) { |t| ... }
click to toggle source
# File lib/autorake/compile.rb, line 48 def tmpfiles source TmpFiles.open source, @verbose==:keep do |t| yield t end end
Public Instance Methods
cc(*a)
click to toggle source
# File lib/autorake/compile.rb, line 15 def cc *a command "CC", "cc" do build *a end end
cxx(*a)
click to toggle source
# File lib/autorake/compile.rb, line 19 def cxx *a command "CXX", "c++" do build *a end end
Also aliased as: cpp
Private Instance Methods
build(*a)
click to toggle source
# File lib/autorake/compile.rb, line 33 def build *a a.flatten! a.compact! a.unshift @cmd puts a.join " " if Builder.verbose f = fork do $stderr.reopen "/dev/null" if Builder.quiet and not Builder.verbose exec *a end Process.waitpid f $?.success? or raise Error, "#{self.class} failed." end
command(env, default) { || ... }
click to toggle source
# File lib/autorake/compile.rb, line 26 def command env, default @cmd = ENV[ env] || default yield ensure @cmd = nil end