Skip to end of metadata
Go to start of metadata

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:

We recommend to use Zeus version 0.13.4.pre2. Zeus can also be installed in a remote SDK.

Please note that you can't use Zeus with RubyMotion apps.

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:

Please note that Zeus doesn't allow to choose environment to run its commands in. So even if environment is chosen for Rails generator or Rake task the command is executed in a default one. Find more details.

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 both Spork and Zeus servers are started tests are run under Zeus by default.

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:

Please note that you need to restart Zeus if any initialization files such as FactoryGirl factories, RSpec support files, and others were changed according to Zeus limitations.

If your Rspec tests are run twice comment require 'rspec/autorun' in your spec_helper.rb according to Zeus issue.

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:

Please note that you're not allowed to debug your tests under Zeus or Spork. Use pre-load server setting in any test run/debug configuration is ignored when the one is started in debug mode.

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:

Please note that Rails console can be run in a default environment only.

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:

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.