README.md in frontkick-0.5.4 vs README.md in frontkick-0.5.5
- old
+ new
@@ -68,16 +68,22 @@
```
ruby
└─ echo
```
-NOTE: This interface is different with Kernel.spawn or Open3.popen3. They works with no shell if multiple arguments are given rather than an array as:
+NOTE: This interface is different with Kernel.spawn or Open3.popen3, but similar to IO.popen. Kernel.spawn or Open3.popen3 works with no shell if multiple arguments are given:
```
spawn('echo', '*')
```
+IO.popen works with no shell if an array argument is given:
+
+```
+IO.popen(['echo', '*'])
+```
+
### Environment Variables
You can pass environment variables as a hash for the 1st argument as [spawn](https://ruby-doc.org/core-2.4.0/Kernel.html#method-i-spawn).
```ruby
@@ -130,9 +136,18 @@
err = File.open('stderr.txt', 'w').tap {|fp| fp.sync = true }
Frontkick.exec(["ls /something_not_found"], :out => out, :err => err)
```
You can also give IO objects. In this case, result.stdout, and result.stderr are the given IO objects.
+
+### Popen2e Option (Get stdout and stderr together)
+
+```ruby
+result = Frontkick.exec("echo foo; ls /something_not_found", :popen2e => true)
+puts result.output #=>
+foo
+ls: /something_not_found: No such file or directory
+```
### Popen3 Options (such as :chdir)
Other options such as :chdir are treated as options of `Open3.#popen3`.