forked from jeremyevans/roda-sequel-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ru
48 lines (38 loc) · 1.17 KB
/
config.ru
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
dev = ENV['RACK_ENV'] == 'development'
if dev
require 'logger'
logger = Logger.new($stdout)
end
require 'rack/unreloader'
Unreloader = Rack::Unreloader.new(subclasses: %w'Roda Sequel::Model', logger: logger, reload: dev, autoload: dev){App}
require_relative 'models'
Unreloader.require('app.rb'){'App'}
run(dev ? Unreloader : App.freeze.app)
unless dev
require 'tilt/sass' unless File.exist?(File.expand_path('../compiled_assets.json', __FILE__))
Tilt.finalize!
RubyVM::YJIT.enable if defined?(RubyVM::YJIT.enable)
end
freeze_core = false
#freeze_core = !dev # Uncomment to enable refrigerator
if freeze_core
begin
require 'refrigerator'
rescue LoadError
else
# When enabling refrigerator, you may need to load additional
# libraries before freezing the core to work correctly. You'll
# want to uncomment the appropriate lines below if you run into
# problems after enabling refrigerator.
# rackup -s webrick
#require 'forwardable'
#require 'webrick'
# rackup -s Puma
#require 'yaml'
#Gem.ruby
# Puma (needed for state file)
#require 'yaml'
# Unicorn (no changes needed)
Refrigerator.freeze_core
end
end