File: tools.rb

package info (click to toggle)
ruby-mina 0.3.7-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 444 kB
  • sloc: ruby: 1,630; makefile: 31
file content (20 lines) | stat: -rw-r--r-- 362 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Mina
  module Tools
    if IO.respond_to?(:popen4)
      def self.popen4(*cmd, &blk)
        IO.popen4 *cmd, &blk
        $?
      end
    else
      def self.popen4(*cmd, &blk)
        require 'open4'
        Open4.popen4 *cmd, &blk
      end
    end

    def self.pfork4(*cmd, &blk)
      require 'open4'
      Open4.pfork4 *cmd, &blk
    end
  end
end