-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.rb
More file actions
47 lines (35 loc) · 1.05 KB
/
init.rb
File metadata and controls
47 lines (35 loc) · 1.05 KB
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
# Load dependencies.
require "bundler"
Bundler.require :default, ENV['RACK_ENV'].to_sym
class Mandrula < Sinatra::Base
# Set the root path for the project.
set :root, lambda { |*args| File.join(File.dirname(__FILE__), *args) }
# Set the views path.
set :views, root('app', 'views')
# Always raise errors.
enable :raise_errors
# Development specific configuration.
configure :development do
register Sinatra::Reloader
enable :show_exceptions
end
# Configure haml.
set :haml, layout: :layout, ugly: true, format: :html5
# Enable Compass Support.
register Sinatra::CompassSupport
# Configure the assets pipeline.
register Sinatra::AssetPack
assets do
# The second parameter defines where the compressed version will be served.
js :app, '/js/app.js', [
'/js/vendor/**/*.js',
'/js/app/**/*.js'
]
css :application, ['/css/*.css']
prebuild true
end
end
# Require application files.
['./app/helpers/**/*.rb', './app/routes/**/*.rb'].each do |path|
Dir[path].sort.each { |file| require file }
end