https://github.com/ahoward/systemu
univeral capture of stdout and stderr and handling of child process pid for windows, *nix, etc.
https://github.com/ahoward/systemu
Keywords from Contributors
rubygems activejob activerecord mvc rack sinatra ruby-gem gem yardoc yard
Last synced: about 5 hours ago
JSON representation
Repository metadata
univeral capture of stdout and stderr and handling of child process pid for windows, *nix, etc.
- Host: GitHub
- URL: https://github.com/ahoward/systemu
- Owner: ahoward
- License: other
- Created: 2010-01-07T20:20:29.000Z (about 16 years ago)
- Default Branch: master
- Last Pushed: 2022-06-23T21:24:33.000Z (over 3 years ago)
- Last Synced: 2026-02-25T12:53:43.901Z (6 days ago)
- Language: Ruby
- Homepage:
- Size: 108 KB
- Stars: 123
- Watchers: 6
- Forks: 31
- Open Issues: 19
- Releases: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
README
NAME
systemu
SYNOPSIS
universal capture of stdout and stderr and handling of child process pid for
windows, *nix, etc.
URIS
http://github.com/ahoward/systemu
http://rubyforge.org/projects/codeforpeople/
INSTALL
gem install systemu
HISTORY
2.0.0
- versioning issue. new gem release.
1.3.1
- updates for ruby 1.9.1
1.3.0
- move to github
1.2.0
- fixed handling of background thread management - needed
Thread.current.abort_on_exception = true
- fixed reporting of child pid, it was reported as the parent's pid before
SAMPLES
<========< samples/a.rb >========>
~ > cat samples/a.rb
#
# systemu can be used on any platform to return status, stdout, and stderr of
# any command. unlike other methods like open3/popen4 there is zero danger of
# full pipes or threading issues hanging your process or subprocess.
#
require 'systemu'
date = %q( ruby -e" t = Time.now; STDOUT.puts t; STDERR.puts t " )
status, stdout, stderr = systemu date
p [ status, stdout, stderr ]
~ > ruby samples/a.rb
[#, "2011-12-11 22:07:30 -0700\n", "2011-12-11 22:07:30 -0700\n"]
<========< samples/b.rb >========>
~ > cat samples/b.rb
#
# quite a few keys can be passed to the command to alter it's behaviour. if
# either stdout or stderr is supplied those objects should respond_to? '<<'
# and only status will be returned
#
require 'systemu'
date = %q( ruby -e" t = Time.now; STDOUT.puts t; STDERR.puts t " )
stdout, stderr = '', ''
status = systemu date, 'stdout' => stdout, 'stderr' => stderr
p [ status, stdout, stderr ]
~ > ruby samples/b.rb
[#, "2011-12-11 22:07:30 -0700\n", "2011-12-11 22:07:30 -0700\n"]
<========< samples/c.rb >========>
~ > cat samples/c.rb
#
# of course stdin can be supplied too. synonyms for 'stdin' include '0' and
# 0. the other stdio streams have similar shortcuts
#
require 'systemu'
cat = %q( ruby -e" ARGF.each{|line| puts line} " )
status = systemu cat, 0=>'the stdin for cat', 1=>stdout=''
puts stdout
~ > ruby samples/c.rb
the stdin for cat
<========< samples/d.rb >========>
~ > cat samples/d.rb
#
# the cwd can be supplied
#
require 'systemu'
require 'tmpdir'
pwd = %q( ruby -e" STDERR.puts Dir.pwd " )
status = systemu pwd, 2=>(stderr=''), :cwd=>Dir.tmpdir
puts stderr
~ > ruby samples/d.rb
/private/var/folders/sp/nwtflj890qnb6z4b53dqxvlw0000gp/T
<========< samples/e.rb >========>
~ > cat samples/e.rb
#
# any environment vars specified are merged into the child's environment
#
require 'systemu'
env = %q( ruby -r yaml -e" puts ENV[ 'answer' ] " )
status = systemu env, 1=>stdout='', 'env'=>{ 'answer' => 0b101010 }
puts stdout
~ > ruby samples/e.rb
42
<========< samples/f.rb >========>
~ > cat samples/f.rb
#
# if a block is specified then it is passed the child pid and run in a
# background thread. note that this thread will __not__ be blocked during the
# execution of the command so it may do useful work such as killing the child
# if execution time passes a certain threshold
#
require 'systemu'
looper = %q( ruby -e" loop{ STDERR.puts Time.now.to_i; sleep 1 } " )
status, stdout, stderr =
systemu looper do |cid|
sleep 3
Process.kill 9, cid
end
p status
p stderr
~ > ruby samples/f.rb
#
"1323666451\n1323666452\n1323666453\n"
Owner metadata
- Name: ara.t.howard
- Login: ahoward
- Email:
- Kind: user
- Description: program computers. run around in mountains. repeat.
- Website: https://www.instagram.com/drawohara/
- Location: Palmer, Alaska
- Twitter: drawohara
- Company: https://www.matanuskafrontiertrek.com/
- Icon url: https://avatars.githubusercontent.com/u/6094?v=4
- Repositories: 162
- Last ynced at: 2023-04-09T05:11:03.110Z
- Profile URL: https://github.com/ahoward
GitHub Events
Total
Last Year
Committers metadata
Last synced: 3 days ago
Total Commits: 47
Total Committers: 14
Avg Commits per committer: 3.357
Development Distribution Score (DDS): 0.404
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| ara.t.howard | a****d@g****m | 28 |
| Vassilis Rizopoulos | v****s@g****m | 3 |
| wipfs | s****f@g****m | 2 |
| Robert Dingwell | b****d@m****g | 2 |
| Aman Gupta | a****n@t****t | 2 |
| Tony Arcieri | t****y@m****m | 2 |
| Reid Vandewiele | r****d@p****m | 1 |
| R.I.Pienaar | r****p@d****t | 1 |
| Philip Arndt | p****t@g****m | 1 |
| Gabriel Horner | g****r@g****m | 1 |
| Eric Hodel | d****n@s****t | 1 |
| Edward Betts | e****d@4****m | 1 |
| Akira Matsuda | r****e@d****p | 1 |
| R E | e****r@R****l | 1 |
Committer domains:
- dio.jp: 1
- 4angle.com: 1
- segment7.net: 1
- devco.net: 1
- puppetlabs.com: 1
- medioh.com: 1
- tmm1.net: 1
- mitre.org: 1
Issue and Pull Request metadata
Last synced: 13 days ago
Total issues: 27
Total pull requests: 29
Average time to close issues: 9 months
Average time to close pull requests: 8 months
Total issue authors: 21
Total pull request authors: 23
Average comments per issue: 1.78
Average comments per pull request: 2.55
Merged pull request: 13
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- ripienaar (4)
- chetan (2)
- mercutiomontague (2)
- richardc (2)
- albertnetymk (1)
- damphyr (1)
- EdwardBetts (1)
- fzakaria (1)
- databus23 (1)
- aslakjo (1)
- rennhak (1)
- jchilders (1)
- wwood (1)
- BrackXs (1)
- bkabrda (1)
Top Pull Request Authors
- damphyr (4)
- frediy (2)
- amatsuda (2)
- markuspg (2)
- grafi-tt (1)
- bhuga (1)
- cldwalker (1)
- andrewdotn (1)
- wipfs (1)
- mooreryan (1)
- bpo (1)
- sferik (1)
- rdingwell (1)
- reisner (1)
- tmm1 (1)
Top Issue Labels
Top Pull Request Labels
Package metadata
- Total packages: 12
-
Total downloads:
- rubygems: 205,021,524 total
- Total docker downloads: 180,256,986
- Total dependent packages: 126 (may contain duplicates)
- Total dependent repositories: 14,521 (may contain duplicates)
- Total versions: 46
- Total maintainers: 9
gem.coop: systemu
universal capture of stdout and stderr and handling of child process pid for windows, *nix, etc.
- Homepage: https://github.com/ahoward/systemu
- Documentation: http://www.rubydoc.info/gems/systemu/
- Licenses: Ruby
- Latest release: 2.6.5 (published almost 11 years ago)
- Last Synced: 2026-03-02T09:33:09.764Z (1 day ago)
- Versions: 18
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 102,517,476 Total
- Docker Downloads: 90,128,493
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.199%
- Downloads: 0.246%
- Docker downloads count: 0.55%
- Maintainers (9)
rubygems.org: systemu
universal capture of stdout and stderr and handling of child process pid for windows, *nix, etc.
- Homepage: https://github.com/ahoward/systemu
- Documentation: http://www.rubydoc.info/gems/systemu/
- Licenses: Ruby
- Latest release: 2.6.5 (published almost 11 years ago)
- Last Synced: 2026-03-01T20:02:45.497Z (2 days ago)
- Versions: 18
- Dependent Packages: 126
- Dependent Repositories: 14,521
- Downloads: 102,504,048 Total
- Docker Downloads: 90,128,493
-
Rankings:
- Downloads: 0.22%
- Dependent packages count: 0.273%
- Dependent repos count: 0.289%
- Docker downloads count: 0.656%
- Average: 1.835%
- Forks count: 4.646%
- Stargazers count: 4.927%
- Maintainers (9)
debian-10: ruby-systemu
- Homepage: https://github.com/ahoward/systemu
- Documentation: https://packages.debian.org/buster/ruby-systemu
- Licenses:
- Latest release: 2.6.5-1 (published 20 days ago)
- Last Synced: 2026-02-13T04:26:27.467Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-systemu
- Homepage: https://github.com/ahoward/systemu
- Documentation: https://packages.debian.org/bullseye/ruby-systemu
- Licenses:
- Latest release: 2.6.5-1.1 (published 21 days ago)
- Last Synced: 2026-02-13T08:25:34.755Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-24.04: ruby-systemu
- Homepage: https://github.com/ahoward/systemu
- Licenses: other
- Latest release: 2.6.5-1.1 (published 19 days ago)
- Last Synced: 2026-02-13T01:03:42.251Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-systemu
- Homepage: https://github.com/ahoward/systemu
- Documentation: https://packages.debian.org/bookworm/ruby-systemu
- Licenses:
- Latest release: 2.6.5-1.1 (published 19 days ago)
- Last Synced: 2026-02-12T23:42:29.869Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-13: ruby-systemu
- Homepage: https://github.com/ahoward/systemu
- Documentation: https://packages.debian.org/trixie/ruby-systemu
- Licenses:
- Latest release: 2.6.5-1.1 (published 19 days ago)
- Last Synced: 2026-02-13T13:20:13.177Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Score: 27.364400586241523