-
Notifications
You must be signed in to change notification settings - Fork 3
/
custom_plan.rb
68 lines (53 loc) · 1.24 KB
/
custom_plan.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
require 'zeus/rails'
module Mongoid
VERSION = "4.0.0"
def self.running_with_passenger?
false
end
end
class CustomPlan < Zeus::Rails
RAILS_ROOT = File.expand_path(File.dirname(__FILE__))
# def my_custom_command
# # see https://github.com/burke/zeus/blob/master/docs/ruby/modifying.md
# end
def after_fork
end
def test_helper
require "helper"
end
def test
bootstrap_tests()
require "micron"
require "micron/app"
::Micron::App.new.run()
end
def server
ENV["IS_RAILS_SERVER"] = "1"
require 'rails/commands/server'
server = ::Rails::Server.new
server.options[:Host] = "0.0.0.0" # workaround for listener being set to 'localhost' which resolves to ::1 on OSX
Dir.chdir(::Rails.application.root)
bixby_bootstrap()
server.start
end
def console
ENV["IS_RAILS_SERVER"] = nil
require 'rails/commands/console'
bixby_bootstrap()
if defined?(Pry) && IRB == Pry
require "pry"
Pry.start
else
::Rails::Console.start(::Rails.application)
end
end
def rake
bixby_bootstrap()
Rake.application.run
end
private
def bixby_bootstrap
require "#{RAILS_ROOT}/config/initializers/bixby_bootstrap"
end
end
Zeus.plan = CustomPlan.new