Skip to content

Instantly share code, notes, and snippets.

@bts
Created August 22, 2010 06:30
Show Gist options
  • Select an option

  • Save bts/543423 to your computer and use it in GitHub Desktop.

Select an option

Save bts/543423 to your computer and use it in GitHub Desktop.

Revisions

  1. bts revised this gist Aug 22, 2010. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion app.rb
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,14 @@
    require 'sass'

    configure do
    Tilt.register 'scss', Tilt::SassTemplate
    set :scss, :syntax => :scss
    end

    get '/stylesheets/:file.css' do |file|
    content_type 'text/css', :charset => 'utf-8'

    sass(file.to_sym, :template_location => 'public/stylesheets')
    # no #scss method is defined (and #sass only looks for .sass files)
    # we must call render ourself:
    render :scss, file.to_sym, :layout => false, :views => './public/stylesheets'
    end
  2. bts revised this gist Aug 22, 2010. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  3. bts revised this gist Aug 22, 2010. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions rackup.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    require 'sass/plugin/rack'

    Sass::Plugin.options[:template_location] = 'public/stylesheets'
    use Sass::Plugin::Rack
  4. bts renamed this gist Aug 22, 2010. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. bts revised this gist Aug 22, 2010. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    require 'sass'

    get '/stylesheet.css' do
    get '/stylesheets/:file.css' do |file|
    content_type 'text/css', :charset => 'utf-8'

    sass(:stylesheet)
    end
    sass(file.to_sym, :template_location => 'public/stylesheets')
    end
  6. bts created this gist Aug 22, 2010.
    7 changes: 7 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    require 'sass'

    get '/stylesheet.css' do
    content_type 'text/css', :charset => 'utf-8'

    sass(:stylesheet)
    end