Module: Sinatra::Mars::Css
- Defined in:
- lib/mars/css.rb
Class Method Summary collapse
-
.registered(app) ⇒ Object
register app.
Class Method Details
.registered(app) ⇒ Object
register app
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/mars/css.rb', line 5 def self.registered(app) # stream images app.get %r{(.css)$} do content_type 'text/css' if File.file?(.views + request.path_info.sub(/\.css$/,'.sass')) sass_file = .views + request.path_info.sub(/\.css$/,'.sass') Sass::Engine.new(open_file(sass_file)).render else open_file(.views + request.path_info) end end end |