Waiting is one of the most annoying part of Rails development. Even when running a server or a test takes just a few seconds it stops developer's flow and becomes a time waste. Zeus is a gem aims to significantly speed up Rails development. It preloads the Rails app and doesn’t have to boot up Rails first so the development tasks take less than one second to run.
0. Prerequisites
Before start working with Zeus be sure that:
- All the gem prerequisites are fulfilled
- The gem is installed
We recommend to use Zeus version 0.13.4.pre2. Zeus can also be installed in a remote SDK.
1. Starting Zeus Server
To start Zeus server please go to Tools | Run Zeus Server... menu. Make sure the server is started and all its commands are available:
2. Running Rails Generators and Rake Tasks Under Zeus
If the server is started all the Rails generators and Rake tasks are running under Zeus. For example to generate a scaffold go to Tools | Run Rails Generator... menu and choose scaffold:
After setting up a new model name and fields all the necessary files are generated with zeus generate scaffold command:
Now the Rake command (Tools | Run Rake Task...) can be invoked:
Migration is done with a help of Zeus as well:
3. Starting Rails Server
To start Rails server using Zeus please go to Run | Edit Configurations... and choose Zeus as a server in Rails run/debug configuration:
Now run the configuration:
If Zeus server is not started, the default Rails server will be started instead.
4. Testing with Zeus
No matter what tests you use, Rspec, Cucumber, Test::Unit, or Minitest, you can run them under Zeus. If you are going to run your tests for the first time just run Zeus server first and then choose the tests to run:
Tests are run under Zeus:
If your tests have been run before with no Zeus started and the corresponding run/debug configuration was already created please go to Run | Edit Configuration... and choose Zeus as a pre-load server:
5. Debugging with Zeus
To debug your Rails app first of all stop Zeus server if it is started and run it in debug mode. When Zeus server was started at the first time Zeus run/debug configuration was created:
To run Zeus server in debug mode go to Run | Debug... menu and choose this run configuration or use the Toolbar:
After Zeus server is started in debug mode run the Rails server under Zeus as it is described above:
Now you can set the breakpoints and debug your app:
6. Using Rails Console Under Zeus
To run Rails console under Zeus first of all run Zeus server and go to Tools | Run Rails Console..., be sure that Use Zeus Server option is checked:
Now the Rails console is started under Zeus:
7. Working with Zeus Commands
If you need to run any Zeus command with custom arguments you can create Zeus Server run/debug configuration. Just go to Run | Edit Configuration..., press + and choose Zeus Server. Now you can choose command and set up the configuration: