This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
guns /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Nov 04 17:06:13 -0800 2009 | |
| |
README.md | Wed Nov 04 22:28:24 -0800 2009 | |
| |
guns.gemspec | Sun Nov 08 20:39:41 -0800 2009 | |
| |
lib/ | Sun Nov 08 20:38:51 -0800 2009 |
README.md
Guns
It has two pipes; got tickets to the show?
A low overhead sh utility to replace session
Install
gem install guns -s http://gemcutter.org
Flexing
DISCLAIMER: It's not recommended to use guns in place of you shell I'm purely using IRB for demonstration
$ irb -r rubygems -r guns
>> Guns.sh "ls not-a-dir"
=> ["", "ls: not-a-dir: No such file or directory\n", 1]
The sh method returns a tuple containing stdout, stderr, and exitstatus.
Die hard
>> Guns.sh! "ls not-a-dir"
Guns::Failure: ls: not-a-dir: No such file or directory
from ./lib/guns.rb:50:in `sh!'
from (irb):3
sh! will raise an error on a non-zero exit status
Environment variables
>> Guns.sh "echo $FOO", "FOO" => "bar"
["bar\n", "", 0]
Further Reading
If you need more flexability and features, see Rush
TODO: Replace popen3
Thanks
Joe Ruscio for helping me debug that nasty deadlock
Ryan Tomayko for Shotgun; where I got started with this
Adam Wiggins for Rush







