Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hassle

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hassle

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

h1. Hassle

Making "SASS":http://sass-lang.com/ less of a hassle on read only filesystems. (like "Heroku":http://heroku.com)

h2. Install

Get it from "Gemcutter.":http://gemcutter.org

gem install hassle -s http://gemcutter.org

h2. Usage

By default, SASS compiles CSS into the @public/@ directory. On platforms like Heroku, "this won't work.":http://docs.heroku.com/constraints#read-only-filesystem Instead, Hassle compiles the SASS for you into @tmp/@ and serves it up via a @Rack::Static@ middleware.

Hassle assumes a few basic things about your setup: There's going to be a @tmp/@ directory where it can write to, and @public/@ is where you store your css. A simple example:

$ tree
.
|-- config.ru
|-- public
|   `-- stylesheets
|       `-- sass
|           `-- application.sass
`-- tmp
    `-- hassle
        `-- stylesheets
            `-- application.css

With a basic SASS file in @public/stylesheets/sass/application.sass@, you can include it in your views with:


Hassle will look at the default sass directory (@public/stylesheets/sass@) and other input directories given in @Sass::Plugin.options[:template_location]@. CSS files are then compiled into @tmp/@ one directory higher than where you specified. Here's a small example of customization:

Sass::Plugin.options[:template_location] = "./public/css/templates"

And after Hassle runs...

$ tree
.
|-- config.ru
|-- public
|   `-- css
|       `-- templates
|           `-- screen.sass
`-- tmp
    `-- hassle
        `-- css
            `-- screen.css

Include this in your views with:


h2. Integration

Here's how to integrate it with your favorite web framework:

h3. Rails

For Rails: @script/plugin install git://github.com/pedro/hassle@. Done. Once you're in production mode, Hassle will kick in and prepare your SASS for all to enjoy.

h3. Sinatra

Here's a sample config.ru that's "up and running.":http://hassle-sinatra.heroku.com

require 'sinatra'
require 'hassle'
require 'haml'

get '/' do
  haml < 'stylesheet', :href => "stylesheets/application.css"}
  %body
    %h1 Hassle!
EOF
end

use Hassle
run Sinatra::Application

And its wonderful SASS file:

$ cat public/stylesheets/sass/application.sass 
h1
  font-size: 11em
  color: purple

h2. Bugs

Found some problems? Post 'em in "Issues":http://github.com/pedro/hassle/issues.

h2. License

Hassle uses the MIT license. Please check the LICENSE file for more details.

FAQs

Package last updated on 17 Oct 2009

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc