summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth Chisamore <schisamo@opscode.com>2011-10-23 22:18:56 -0400
committerSeth Chisamore <schisamo@opscode.com>2011-10-23 22:18:56 -0400
commit3d9f28396dd49c02733688af835d1bdc386498e1 (patch)
tree6b6f2e9231570653cec328af093176b5150e27c2
parentcb0666616c232ddb3c39838552c335539906bd56 (diff)
downloadmixlib-shellout-3d9f28396dd49c02733688af835d1bdc386498e1.tar.gz
patch to fix [CHEF-2684], Open4 is named Open3 in Ruby 1.9
-rw-r--r--libraries/ruby_19_patches.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/libraries/ruby_19_patches.rb b/libraries/ruby_19_patches.rb
new file mode 100644
index 0000000..b2a6d77
--- /dev/null
+++ b/libraries/ruby_19_patches.rb
@@ -0,0 +1,24 @@
+# patch to fix CHEF-2684
+if RUBY_VERSION =~ /^1\.8/
+ require 'win32/open3'
+else
+ require 'open3'
+end
+
+class Chef
+ module Mixin
+ module Command
+ module Windows
+
+ module Open4
+ def self.popen4(*cmd, &block)
+ Open3.popen3(*cmd) do |i, o, e, t|
+ block.call(i, o, e, t.pid)
+ end
+ end
+ end
+
+ end
+ end
+ end
+end