README.md in net-ssh-session-0.1.4 vs README.md in net-ssh-session-0.1.5
- old
+ new
@@ -116,10 +116,12 @@
```
To get each command result after execution, you can supply a block:
```ruby
+commands = ["mkdir /tmp", "echo test > /tmp/file", "rm -rf /tmp"]
+
session.run_multiple(commands) do |cmd|
puts "Original command: #{cmd.command}"
puts "Exit code: #{cmd.exit_code}"
puts "Output: #{cmd.output}"
end
@@ -172,20 +174,35 @@
s.run("bundler install --path .")
s.close
```
-You can also disable histroy for the whole session:
+You can also disable history for the whole session:
```ruby
Net::SSH::Session.new(host, user, password, :history => false)
```
+## Execute any command with timeout
+
+To enable session-wide command execution timeout, pass an extra option:
+
+```ruby
+session = Net::SSH::Session.new(host, user, password, :timeout => 10)
+```
+
+This will limit any command execution time to 10 seconds. Error `Timeout::Error`
+will be raised when timeout is exceeded.
+
## Credits
Library code was extracted and modified from multiple sources:
- Dan Sosedoff (@sosedoff)
- Mitchell Hashimoto (@mitchellh)
- Michael Klishin (@michaelklishin)
- Sven Fuchs (@svenfuchs)
-- Travis-CI (@travis-ci)
+- Travis-CI (@travis-ci)
+
+## License
+
+See LICENSE file for details
\ No newline at end of file