From: Robert Klemme Date: 2009-08-13T04:40:12+09:00 Subject: Re: Windows ENV object being corrupted On 12.08.2009 18:17, Robert Klemme wrote: > And what is your aim, i.e. what do you want to achieve? If you want > to set environment variables for your Ruby script, you could easily do > this instead: > > File.foreach "setEnvironment.bat" do |line| > if /^\s*([^\s=]+)\s*=\s*(.*)$/ =~ line > ENV[$1] = $2 > end > end Pardon, should have been File.foreach "setEnvironment.bat" do |line| if /^\s*SET\s*([^\s=]+)\s*=\s*(.*)$/i =~ line ENV[$1] = $2 end end Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/