[Instantrails-users] Fwd: An absolute minimal install of ruby and rails.

Tim Uckun timuckun at gmail.com
Tue Sep 19 01:41:52 EDT 2006


"When you run InstantRails.exe in a new directory, he'll detect that
and update all of those paths to the new location."

Here is a cool trick I cooked up. Feel free to grab it and pass it on.

I have written the following batch file, the REMs explain what is
going on. This would work for most scripts I would think. You could
expand it by doing even more trickery if you wanted to.
.
-----------------SNIP-------------------------------
@REM  Generic Batch file for running ruby scripts
@REM  This file takes it's name, strips off the '.cmd' at the end
@REM   and then passes the remaining to the ruby executable in it's
own directory.
@REM   It should be used in the ruby/bin directory.
@REM
@REM   EXAMPLE:  if you wanted to run the cap script in the ruby/bin directory
@REM              you would copy this batch file to a file called cap.cmd.
@REM              this way you could set up a .cmd file for all the
ruby scripts in your ruby/bin

@set BINPATH=%~dp0
@set RUBY=%BINPATH%ruby
@set FILENAME=%~nx0
@set SCRIPTNAME=%FILENAME:~0,-4%

%RUBY% "%BINPATH%%SCRIPTNAME%" %*


More information about the Instantrails-users mailing list