Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BOOM! Sass/scss in there now too.

  • Loading branch information...
commit 895a4b08f49125b84ccf80a730a7c26c432d6078 1 parent c95c6be
Glen Maddern authored
Showing with 7 additions and 2 deletions.
  1. +1 −0  Gemfile
  2. +2 −0  Gemfile.lock
  3. +4 −2 server.rb
1  Gemfile
View
@@ -5,3 +5,4 @@ gem 'haml'
gem 'coffee-script'
gem 'curb'
gem 'json'
+gem 'sass'
2  Gemfile.lock
View
@@ -16,6 +16,7 @@ GEM
rack (1.4.1)
rack-protection (1.2.0)
rack
+ sass (3.1.15)
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
@@ -34,5 +35,6 @@ DEPENDENCIES
curb
haml
json
+ sass
sinatra
thin
6 server.rb
View
@@ -3,6 +3,7 @@
require 'haml'
require 'curb'
require 'json'
+require 'sass'
def gist_id
@gist_id ||= request.host[/^(\w+)\./, 1]
@@ -28,9 +29,10 @@ def files
COMPILERS = {
js: {js: -> js { js }, coffee: -> js { CoffeeScript.compile js } },
- html: {html: -> html { html }, haml: -> html { Haml::Engine.new(html, format: :html5).render }}
+ html: {html: -> html { html }, haml: -> html { Haml::Engine.new(html, format: :html5).render }},
+ css: {css: -> css { css }, scss: -> css { Sass.compile(css, syntax: :scss)}, sass: -> css { Sass.compile(css, syntax: :sass) }}
}
-TYPES = { js: "application/javascript", html: "text/html" }
+TYPES = { js: "application/javascript", html: "text/html", css: "text/css" }
get '/*' do
if gist_id
Please sign in to comment.
Something went wrong with that request. Please try again.