https://github.com/ericlondon/ruby-exec-shell-with-timeout
Ruby Exec Shell With Timeout
https://github.com/ericlondon/ruby-exec-shell-with-timeout
pty ruby shell timeout
Last synced: 8 months ago
JSON representation
Ruby Exec Shell With Timeout
- Host: GitHub
- URL: https://github.com/ericlondon/ruby-exec-shell-with-timeout
- Owner: EricLondon
- Created: 2013-07-19T11:20:05.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-19T15:27:11.000Z (almost 12 years ago)
- Last Synced: 2025-01-12T01:24:28.200Z (9 months ago)
- Topics: pty, ruby, shell, timeout
- Language: Ruby
- Size: 121 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Ruby-Exec-Shell-With-Timeout
============================Ruby Exec Shell With Timeout
Example Usage (see: example.rb)
```ruby
#!/usr/bin/env rubyrequire 'rubygems'
# include path
$:.unshift File.dirname(__FILE__)require 'exec_with_timeout.rb'
command = %{ruby -e "(1..100).each {|x| puts x; sleep 1}"}
output = Exec_With_Timeout.exec command, 10
puts output
``````bash
$ ./example.rb
1
2
3
4
5
6
7
8
9
10
```