summaryrefslogtreecommitdiff
path: root/libraries/ruby_19_patches.rb
blob: b97d7394a1c70ec299fdd43a12ecd83231806ffc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# patch to fix CHEF-2684
if RUBY_PLATFORM =~ /mswin|mingw32|windows/
  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
end