diff --git a/lib/open3.rb b/lib/open3.rb index c29a622c1b..459bee4607 100644 --- a/lib/open3.rb +++ b/lib/open3.rb @@ -163,6 +163,17 @@ module Open3 # stdin.close # stdin and stdout_and_stderr should be closed explicitly in this form. # stdout_and_stderr.close # + # Example: + # # check gcc warnings + # source = "foo.c" + # Open3.popen2e("gcc", "-Wall", source) {|i,oe,t| + # oe.each {|line| + # if /warning/ =~ line + # ... + # end + # } + # } + # def popen2e(*cmd, &block) if Hash === cmd.last opts = cmd.pop.dup