-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.ru
83 lines (64 loc) · 1.84 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# frozen_string_literal: true
require 'rubygems'
require 'bundler'
Bundler.require :default, :development
ENV['DEMO_MODE'] = '1'
DemoMode.configure do
current_user_method :current_dummy_user
signinable_username_method :name
sign_up_path { foo_path }
sign_in_path { bar_path }
splash_base_controller_name 'ApplicationController'
display_credentials true
persona :the_everyperson do
features << ''
callout true
sign_in_as { DummyUser.create!(name: SecureRandom.uuid) }
end
end
DemoMode.add_persona :the_sometimesperson do
features << 'foobar'
callout true
icon 'demo_mode/icon--tophat'
sign_in_as { DummyUser.create!(name: SecureRandom.uuid) }
variant :the_rarely_person do
sign_in_as { DummyUser.create!(name: SecureRandom.uuid) }
end
end
DemoMode.add_persona :the_manyperson do
features << 'shared account'
features << 'other feature'
features << 'lots of features'
icon :users
callout true
sign_in_as { DummyUser.create!(name: SecureRandom.uuid) }
end
DemoMode.add_persona :the_less_important_person do
features << 'rare feature'
sign_in_as { DummyUser.create!(name: SecureRandom.uuid) }
end
DemoMode.add_persona :the_other_person do
features << 'feature 1'
features << 'nice feature'
features << 'really important feature'
variant 'ron' do
sign_in_as { DummyUser.create!(name: "ron#{SecureRandom.uuid}") }
end
variant 'jan' do
sign_in_as { DummyUser.create!(name: "jan#{SecureRandom.uuid}") }
end
end
DemoMode.add_persona :redirects_to_not_found do
features << 'redirects to a 404'
display_credentials false
begin_demo do
redirect_to '/not_found_oh_no'
end
sign_in_as { Widget.create! }
end
Combustion.path = 'spec/dummy'
Combustion.initialize! :all do
config.active_job.queue_adapter = :async
end
run Combustion::Application
system 'open http://localhost:9292'