Requirements
Scatate Tool is a handy command line tool for working with Scalate. It provides various features such as
- Creating new projects using Scalate
- Converting existing JSP files over to Scalate
- Generating static websites
Scalate Tool has the following requirements
- Scalate requires a Java development kit of version 1.5 or later
To get started with the Scalate Tool you'll need to download and install it.
Download a distribution such as 1.3 zip or tar.gz
The installation step is really just about adding the bin/scalate script to your PATH so that its easy to run the tool from any directory you happen to be in. If you know how to do that kind of stuff go right ahead. e.g. you could just create a symlink to it in a directory thats already on your path like /usr/local/bin or ~/.bin
Or you can just run the scalate script directly from your download if you prefer. There follows detailed instructions on how to install the scalate tool to ensure you can run the tool from any directory.
Windows 2000/XP
- Unzip the distribution archive, i.e. scalate-1.3-windows-bin.zip to the directory you wish to install Scalate 1.3. These instructions assume you chose C:\Program Files\Scala. The subdirectory scalate-1.3 will be created from the archive.
- Add the C:\Program Files\Scala\scalate-1.3 directory to the PATH environment variable by
- Opening up the system properties (WinKey + Pause)
- Selecting the “Advanced” tab, and the “Environment Variables” button
- Update/create the PATH variable in the user variables prepending the value C:\Program Files\Scala\scalate-1.3
- Be sure to omit any quotation marks around the path even if it contains spaces.
- In the same dialog, make sure that JAVA_HOME exists in your user variables or in the system variables and it is set to the location of your JDK, e.g. C:\Program Files\Java\jdk1.5.0_02 and that %JAVA_HOME%\bin is in your Path environment variable.
Open a new command prompt (Winkey + R then type cmd) and run the following to verify that it is correctly installed.
scalate
Unix-based Operating Systems (Linux, Solaris and Mac OS X)
- Extract the distribution archive, i.e. scalate-1.3-unix-bin.tar.gz to the directory you wish to install Scalate 1.3. These instructions assume you chose /usr/local/scala. The subdirectory scalate-1.3 will be created from the archive.
In a command terminal, prepend the PATH variable with the bin directory in the scalate release. e.g.
export PATH=/usr/local/scala/scalate-1.3/bin:$PATH
Make sure that JAVA_HOME is set to the location of your JDK and that $JAVA_HOME/bin is in your PATH environment variable, e.g.
export JAVAHOME=/usr/java/jdk1.5.002 export PATH=$JAVA_HOME/bin:$PATH
Run the following to verify that it is installed correctly
scalate
Mac OS X and Homebrew
If you use OS X then we highly recommend using Homebrew to manage installation of tools. If you have not done so already please Install Homebrew.
Once you have Homebrew installed you can install Scalate via this command
brew install scalate
The scalate executable should now be available from any terminal. To verify this works try typing
scalate
Using the Scalate Tool
Once you have installed the Scalate Tool via one of the above methods, you should be able to use the scalate executable on the command line.
The scalate tool supports a number of sub commands rather like git or svn. You can invoke a sub command directly such as
scalate run myTemplate.ssp
you can get a list of all the available sub commands via
scalate help
or to get help on a specific command you can type
scalate --help
or enter the Scalate interactive shell via
scalate
Once in the shell help will apppear to help guide you through the available commands. The shell supports tab completion rather like bash to help you execute the commands easily.