Skip to content

Commit

Permalink
Add documentation built into rvm for wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Sutto committed May 21, 2010
1 parent d2982a8 commit ac985e1
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README
Expand Up @@ -59,6 +59,10 @@ Action
uninstall - uninstall one or many ruby versions, leaves their sources uninstall - uninstall one or many ruby versions, leaves their sources
remove - uninstall one or many ruby versions and remove their sources remove - uninstall one or many ruby versions and remove their sources


wrapper - generates a set of wrapper executables for a given ruby with the
specified ruby and gemset combination. Used under the hood for
passenger support and the like.

ruby - runs a named ruby file against specified and/or all rubies ruby - runs a named ruby file against specified and/or all rubies
gem - runs a gem command using selected ruby's 'gem' gem - runs a gem command using selected ruby's 'gem'
rake - runs a rake task against specified and/or all rubies rake - runs a rake task against specified and/or all rubies
Expand Down
41 changes: 41 additions & 0 deletions help/wrapper
@@ -0,0 +1,41 @@

∴ rvm wrapper [ruby_string] [wrapper_prefix] [binary[ binary[ ...]]]

Where ruby_string is the ruby version and gemset combination to wrap,
wrapper prefix is what to prepend to the name of the generated wrapper
binaries and binaries is the names of the binaries you wish to provide
a wrapper for (e.g. gem).

When no binaries are provided, rvm will by default generate wrappers for
ruby, gem, rake, irb, rdoc, ri, and testrb.

Examples:

If you wish to provide an environment-specific wrapper for rspec with a
rails 3 gemset, you could do:

∴ rvm --create ree@rails3
∴ rvm wrapper ree@rails3 r3 spec

Which would add r3_spec with the specified environment to your the bin
directory where you installed rvm.

Alternatively, if you do:

∴ rvm wrapper ruby-1.9.2-head

It will create binaries named ruby,gem, rake, irb, rdoc, ri and tesrb
in the rvm bin directory.

Finally, to show another real and common use, you can use wrapper
to generate ruby executables and gems for passenger to use. Namely:

∴ rvm use ree@rails3 --passenger

is equivelant to:

∴ rvm use ree@rails3
∴ rvm wrapper ree@rails3 passenger

Which creates passenger_* binaries in the rvm bin directory using
ree and the rails3 gemset.
3 changes: 2 additions & 1 deletion scripts/wrapper
Expand Up @@ -20,7 +20,8 @@ wrap() {


usage() { usage() {
printf "Usage: 'rvm wrapper [ruby_string] [wrapper_prefix] [binary[ binary[ ...]]]'\n" printf "Usage: 'rvm wrapper [ruby_string] [wrapper_prefix] [binary[ binary[ ...]]]'\n"
printf " Where binary is in {ruby,gem,rake,irb,rdoc,ri,testrb}\n" printf " Where binary defaults to ruby, gem, rake, irb, rdoc, ri, testrb\n"
printf " For more information, see 'rvm help wrapper'\n"
} }


args="$*" args="$*"
Expand Down

0 comments on commit ac985e1

Please sign in to comment.