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 (
rush /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Tue Feb 19 17:32:42 -0800 2008 | |
| |
README | ||
| |
Rakefile | Wed Mar 26 00:45:32 -0700 2008 | |
| |
bin/ | Thu Mar 27 15:09:15 -0700 2008 | |
| |
lib/ | ||
| |
spec/ |
README
= rush -- manage your unix systems with pure Ruby
rush is a replacement for the unix shell (bash, zsh, etc) which uses pure Ruby syntax. Grep through files, find and kill
processes, copy files - everything you do in the shell, now in Ruby.
== Usage
Previously if you wanted to count the number of classes in your project, you might use a bash command like:
find myproj -name \*.rb | xargs grep '^\s*class' | wc -l
In rush, this is:
myproj['**/*.rb'].search(/^\s*class/).lines.size
How about killing those pesky stray mongrels? Before:
kill `ps aux | grep mongrel_rails | grep -v grep | cut -c 10-20`
After:
processes.find_all_by_cmdline(/mongrel_rails/).each { |p| p.kill }
But rush is more than just an interactive shell and a library: it can also control any number of remote machines from a
single location. Copy files or directories between servers as seamlessly as if it was all local.
Example of remote access:
local = Rush::Box.new('localhost')
remote = Rush::Box.new('my.remote.server.com')
local_dir = local['/Users/adam/myproj/']
remote_dir = remote['/home/myproj/app/']
local_dir.copy_to remote_dir
remote_dir['**/.svn/'].each { |d| d.destroy }
Clustering? Well, if you insist:
local_dir = Rush::Box.new('localhost')['/Users/adam/server_logs/'].create
servers = %w(www1 www2 www3).map { |n| Rush::Box.new(n) }
servers.each { |s| s['/var/log/nginx/access.log'].copy_to local_dir["#{s.host}_access.log"] }
== Invoking the shell
Run the "rush" binary to enter the interactive shell.
== Reference
For more details on syntax and commands, see:
* Rush::Box
* Rush::Entry
* Rush::Commands
* Rush::File
* Rush::Dir
* Rush::Process
== Meta
rush was written by Adam Wiggins (adam at heroku dot com)
Patches contributed by: Chihiro Ito, Gabriel Ware, Michael Schutte, and Ricardo Chimal Jr.
Logo by James Lindenbaum
rush is released under the MIT License: http://www.opensource.org/licenses/mit-license.php
http://rush.heroku.com








