forked from hotsh/rstat.us
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ru
50 lines (39 loc) · 1.23 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
require 'rubygems'
require 'bundler/setup'
require "sprockets"
require 'uglifier'
require 'sass'
require File.dirname(__FILE__) + '/rstatus'
ENV['RACK_ENV'] ||= "development"
unless ENV['RACK_ENV'] == "production"
config = YAML.load_file(File.join(File.dirname(__FILE__) + '/config/config.yml'))[ENV['RACK_ENV']]
config.each do |key, value|
ENV[key] = value
end
else
require 'exceptional'
use Rack::Exceptional, ENV['EXCEPTIONAL_KEY']
end
Assets = Sprockets::Environment.new(Rstatus.root.to_s)
Assets.static_root = File.join(Rstatus.root, "public", "assets")
Assets.paths << "assets"
Assets.logger = Rstatus.log
# Assets.js_compressor = Uglifier.new
Sass::Engine::DEFAULT_OPTIONS[:load_paths].tap do |load_paths|
load_paths << "#{Rstatus.root}/assets/stylesheets"
load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/blueprint/stylesheets"
end
compressor = Object.new
def compressor.compress(source)
Sass::Engine.new(source,
:syntax => :scss, :style => :compressed
).render
end
Assets.css_compressor = compressor
map "/assets" do
run Assets
end
map "/" do
run Rstatus
end