On Sep 26, 2008, at 12:18 PM, Turpin, Jay wrote:

OK - now I understand why this was done. However, the CALL command is choking on any commands sent to sh that contains a newline character. It's not pretty, but this fix appears to resolve the problem (at least all of the tests pass):

# Run a command line on windows.
def rake_system(*cmd)
 perform_variable_expansion cmd[0]
 system(*cmd)
end

def perform_variable_expansion(cmd)
 ENV.each do |k, v|
   cmd.sub!(/\%#{k}\%/i, v)
 end
end

Perform the variable expansion by hand?  Ok by me.

I'm thinking I like this for the expansion:

def perform_variable_expansion(cmd)
  s.gsub!(/%([A-Za-z_]+)%/) { |k| ENV[$1] || k }
end


--
-- Jim Weirich
-- [EMAIL PROTECTED]

_______________________________________________
Rake-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rake-devel

Reply via email to