From cb22dd390852504ba7b6afe1ffb92808e3fbc2cd Mon Sep 17 00:00:00 2001
From: Martin Kuehl <martin.kuehl@gmail.com>
Date: Wed, 25 Mar 2009 18:54:38 +0100
Subject: [PATCH 5/7] =?utf-8?q?=E2=80=A2=20Split=20generation=20of=20the=20Process.run=20options=20hash=20into=20two=20steps:
=20=20=201.=20Set=20options=20with=20known=20default=20values.
=20=20=202.=20Set=20options=20that=20are=20being=20passed=20through=20via=20the=20given=20options=20hash.
=20=E2=80=A2=20Declare=20:env=20as=20an=20options=20to=20be=20passed=20through.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

---
 lib/tm/executor.rb |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/lib/tm/executor.rb b/lib/tm/executor.rb
index a09c274..d6cd02e 100644
--- a/lib/tm/executor.rb
+++ b/lib/tm/executor.rb
@@ -72,6 +72,8 @@ module TextMate
                    :env             => nil,
                    :script_args     => [],
                    :use_hashbang    => true}
+        
+        passthrough_options = [:env]
 
         options[:bootstrap] = ENV["TM_BUNDLE_SUPPORT"] + "/bin/bootstrap.sh" unless ENV["TM_BUNDLE_SUPPORT"].nil?
 
@@ -116,6 +118,9 @@ module TextMate
             end
           end
           
+          process_options = {:echo => true, :watch_fds => { :echo => tm_echo_fd_read }}
+          passthrough_options.each { |key| process_options[key] = options[key] if options.has_key?(key) }
+          
           io << "<!-- » #{args[0,args.length-1].join(" ")} #{ENV["TM_DISPLAYNAME"]} -->"
           
           if options.has_key?(:bootstrap) and File.exists?(options[:bootstrap])
@@ -125,7 +130,7 @@ module TextMate
           
           start = Time.now
           process_output_wrapper(io) do
-            TextMate::Process.run(args, :env => options[:env], :echo => true, :watch_fds => { :echo => tm_echo_fd_read }, &callback)
+            TextMate::Process.run(args, process_options, &callback)
           end
           finish = Time.now
           
-- 
1.6.1.3

