Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Better Compass integration for Sinatra (extracted from BigBand).

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 sinatra-compass.gemspec
README.md

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.

Something went wrong with that request. Please try again.