---
- - match
- 6
- "@@ -6,12 +6,18 @@ module Popen"
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6
- match
- 6
- "@@ -6,12 +6,18 @@ module Popen"
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6
- -
- 6
- |2
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6
-
- 6
- |2
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6
- -
- 7
- |2
def popen(cmd, path=nil)
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_7_7
-
- 7
- |2
def popen(cmd, path=nil)
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_7_7
- -
- 8
- |2
unless cmd.is_a?(Array)
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_8_8
-
- 8
- |2
unless cmd.is_a?(Array)
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_8_8
- - old
- 9
- |
- raise "System commands must be given as an array of strings"
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_9_9
- new
- 9
- |
+ raise RuntimeError, "System commands must be given as an array of strings"
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_9
- -
- 10
- |2
end
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_10
-
- 10
- |2
end
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_10
- -
- 11
- |2
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_11_11
-
- 11
- |2
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_11_11
- -
- 12
- |2
path ||= Dir.pwd
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_12_12
-
- 12
- |2
path ||= Dir.pwd
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_12_12
- - old
- 13
- |
- vars = { "PWD" => path }
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_13_13
- old
-
- " "
-
- - old
- 14
- |
- options = { chdir: path }
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_14_13
- new
- 13
- |
+
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_13
- -
-
- " "
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_14
- new
- 14
- |
+ vars = {
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_14
- -
-
- " "
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_15
- new
- 15
- |
+ "PWD" => path
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_15
- -
-
- " "
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_16
- new
- 16
- |
+ }
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_16
- -
-
- " "
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_17
- new
- 17
- |
+
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_17
- -
-
- " "
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_18
- new
- 18
- |
+ options = {
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_18
- -
-
- " "
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_19
- new
- 19
- |
+ chdir: path
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_19
- -
-
- " "
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_20
- new
- 20
- |
+ }
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_20
- -
- 15
- |2
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_21
-
- 21
- |2
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_21
- -
- 16
- |2
unless File.directory?(path)
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_16_22
-
- 22
- |2
unless File.directory?(path)
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_16_22
- -
- 17
- |2
FileUtils.mkdir_p(path)
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_17_23
-
- 23
- |2
FileUtils.mkdir_p(path)
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_17_23
- - match
- 19
- "@@ -19,6 +25,7 @@ module Popen"
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25
- match
- 25
- "@@ -19,6 +25,7 @@ module Popen"
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25
- -
- 19
- |2
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25
-
- 25
- |2
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25
- -
- 20
- |2
@cmd_output = ""
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_20_26
-
- 26
- |2
@cmd_output = ""
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_20_26
- -
- 21
- |2
@cmd_status = 0
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_21_27
-
- 27
- |2
@cmd_status = 0
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_21_27
- -
-
- " "
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_28
- new
- 28
- |
+
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_28
- -
- 22
- |2
Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_29
-
- 29
- |2
Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_29
- -
- 23
- |2
@cmd_output << stdout.read
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_23_30
-
- 30
- |2
@cmd_output << stdout.read
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_23_30
- -
- 24
- |2
@cmd_output << stderr.read
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_24_31
-
- 31
- |2
@cmd_output << stderr.read
- 2f6fcd96b88b36ce98c38da085c795a27d92a3dd_24_31