zeus

Boot any rails app in under a second.

  • 所有者: burke/zeus
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Zeus

Join the chat at https://gitter.im/zeus-application-preloader/Lobby
Build Status

Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.

This screencast gives a quick overview of how to use zeus with Rails.

Watch the screencast!

Zeus is also covered in RailsCasts episode 412.

More generally, Zeus is a language-agnostic application checkpointer for non-multithreaded applications. Currently only ruby is targeted, but explicit support for other languages is possible.

Requirements (for use with Rails)

  • OS X 10.7+ OR Linux 2.6.13+
  • Rails 3.x or 4.x
  • Compatible Ruby installation
    • Ruby 2.0+
    • Rubinius

Please note: Zeus requires your project to be running on a file system that supports FSEvents or inotify. This means no NFS, CIFS, Samba, or VBox/VMWare shared folders.

Installation

Install the gem.

gem install zeus

Q: "I should put it in my Gemfile, right?"

A: No. You can, but running bundle exec zeus instead of zeus adds precious seconds to commands that otherwise would be quite a bit faster. Zeus was built to be run from outside of bundler.

IMPORTANT

It is common to see tests running twice when starting out with Zeus. If you see your tests/specs running twice, you should try disabling require 'rspec/autotest' and require 'rspec/autorun' (for RSpec), or require 'minitest/autorun' (for Minitest). (see #134 for more information).

Rails Set up

In your app's directory initialize zeus:

zeus init

which will create two files

custom_plan.rb
zeus.json

Force the test environment: In test/test_helper.rb (or spec/spec_helper.rb if using RSpec), change:

ENV['RAILS_ENV'], = 'test'

To:

ENV['RAILS_ENV'] = 'test'

More helpful set up hints at this very nice guide put together by Thoughtbot

Usage

Start the server:

zeus start

The server will print a list of available commands.

Run some commands in another shell:

zeus console
zeus server
zeus test test/unit/widget_test.rb
zeus test spec/widget_spec.rb
zeus generate model omg
zeus rake -T
zeus runner omg.rb

Limitations

You need to restart zeus if you make changes to various initialization files. Examples of these files include:

  • FactoryGirl factories
  • RSpec support files
  • Spork - a DRb server that forks before each run to ensure a clean testing state
  • Commands - a persistent console that runs Rails commands without reloading the env
  • Spring - like Zeus but in pure Ruby, totally automatic, and included in Rails 4.1+.

If you're switching from Spork, be sure to read the wiki page on Spork.

Customizing Zeus Commands

To add/modify commands, see docs/ruby/modifying.md.

Contributing

To get started hacking on Zeus itself, see docs/overview.md.

See also the handy contribution guide at contributing.md.

Rails 2.3 Support

The default plan bundled with zeus only supports Rails 3.x and 4.x. There is a project to provide Rails 2.3 support here, however it has not been updated in some time.

Legacy Ruby Versions

Due to official Ruby support lapsing in Feb 2015, Ruby 1.9.3 and below are no longer officially supported. Zeus may work with them but we are not actively supporting them at this time. The last release tested with these versions is 0.15.4.

主要指標

概覽
名稱與所有者burke/zeus
主編程語言Go
編程語言Ruby (語言數: 6)
平台
許可證MIT License
所有者活动
創建於2012-07-26 22:32:00
推送於2024-09-11 17:59:19
最后一次提交2024-09-11 12:59:16
發布數31
最新版本名稱v0.16.0 (發布於 )
第一版名稱v0.2.1 (發布於 )
用户参与
星數3.3k
關注者數46
派生數225
提交數0.9k
已啟用問題?
問題數499
打開的問題數102
拉請求數149
打開的拉請求數2
關閉的拉請求數33
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?