-
Notifications
You must be signed in to change notification settings - Fork 9
/
config.ru
45 lines (35 loc) · 1.1 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
# frozen_string_literal: true
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) { App }
require_relative 'models'
Unreloader.require('app.rb') { 'App' }
run(dev ? Unreloader : App.freeze.app)
freeze_core = false
# freeze_core = !dev # Uncomment to enable refrigerator
if freeze_core
begin
require 'refrigerator'
rescue LoadError
else
require 'tilt/sass' unless File.exist?(File.expand_path('compiled_assets.json', __dir__))
# 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