forked from kennethkalmer/ruote-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ru
60 lines (41 loc) · 934 Bytes
/
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
49
50
51
52
53
54
55
56
57
58
59
# bundler
begin
# try to require the preresolved locked set of gems.
require ::File.expand_path('.bundle/environment', __FILE__)
rescue LoadError
# fall back on doing an unlocked resolve at runtime.
require 'rubygems'
require 'bundler'
Bundler.setup(:default)
end
# json
#
# try yajl-ruby first, and json after that
begin
require 'yajl'
rescue LoadError
begin
require 'json'
rescue LoadError
puts 'Please specify "gem {yajl-ruby|json_pure|json}" in the Gemfile'
exit
end
end
require 'rufus-json'
# ruote-kit
$:.unshift 'lib'
require 'ruote-kit'
# ruote
require 'ruote/storage/fs_storage'
RuoteKit.engine = Ruote::Engine.new(
Ruote::Worker.new(
Ruote::FsStorage.new(
"ruote_work_#{RuoteKit.env}")))
RuoteKit.engine.register do
catchall
end
# rack middlewares, business as usual...
use Rack::CommonLogger
use Rack::Lint
use Rack::ShowExceptions
run RuoteKit::Application