-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapplication.rb
48 lines (41 loc) · 1012 Bytes
/
application.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
require 'bundler/setup'
require 'sinatra'
require 'sinatra/json'
require 'sinatra/streaming'
require 'sinatra/reloader'
require 'cgi'
require 'json'
require 'digest/md5'
require 'zlib'
require 'stringio'
require 'haml'
require 'mechanize'
if File.exists?(".env")
require 'dotenv'
Dotenv.load
end
# RAILS_ENV is set via unicorn in production and used
# by test_helper to also set the environment.
set(:environment, ENV['RACK_ENV']) unless ENV['RACK_ENV'].nil?
set :public_folder, Proc.new { File.join(root, "public") }
set :logging, true
set :raise_errors, true
set :show_exceptions, false
set :dump_errors, true
if settings.environment == "development"
require 'pry'
require 'sinatra/reloader'
end
Dir[File.join(File.dirname(__FILE__),'config', 'initializers','*.rb')].
each { |a| require_relative a }
[
['routes'],
['models'],
['lib'],
['models/csc'],
].each do |path|
Dir[File.join(File.dirname(__FILE__), path, '*.rb')].each { |f| require f }
end
helpers do
include ViewHelpers
end