0.01
No commit activity in last 3 years
No release in over 3 years
Better Compass integration for Sinatra (part of BigBand).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.3.0

Runtime

>= 0.8.17
~> 0.5.0
~> 0.5.0
~> 1.0
 Project Readme

Sinatra::Compass

Integrates the Compass stylesheet framework with Sinatra.

BigBand

Sinatra::Compass is part of the BigBand stack. Check it out if you are looking for other fancy Sinatra extensions.

Installation

gem install sinatra-compass

Usage

Usage without doing something:

require "sinatra"
require "sinatra/compass"

If you create a directory called views/stylesheets and place your sass files in there, there you go. Just call stylesheet(name) form your view to get the correct stylesheet tag. The URL for your stylesheets will be /stylesheets/:name.css.

Of course you can use any other setup. Say, you want to store your stylesheets in views/css and want the URL to be /css/:name.css:

get_compass("css")

But what about more complex setups?

require "sinatra/base"
require "sinatra/compass"

class Foo < Sinatra::Base
  register Sinatra::Compass
  set :compass, :sass_dir => "/foo/bar/blah"
  get_compass("/foo/:name.css") do
    compass :one_stylesheet
  end
end

Note that already generated routes will be deactivated by calling get_compass again.