Project

grease

0.14
No release in over 3 years
Low commit activity in last 3 years
Grease provides an adapter to use Tilt as extension of Sprockets 3 or later.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Grease

Gem Version Build Status Code Climate Test Coverage

Grease provides an adapter to use Tilt as extension of Sprockets 3 or later.

Installation

Add this line to your application's Gemfile:

gem "grease"

And then execute:

$ bundle

Or install it yourself as:

$ gem install grease

Usage

When you'd like to use Tilt::HamlTemplate in Sprockets, add code like this:

# Sprockets 3
register_engine ".haml", Grease.apply(Tilt::HamlTemplate), mime_type: Tilt::HamlTemplate.default_mime_type, silence_deprecation: true

# Sprockets 4 or later
register_mime_type "text/haml", extensions: %w(.haml .html.haml)
register_transformer "text/haml", Tilt::HamlTemplate.default_mime_type, Grease.apply(Tilt::HamlTemplate)

It works because Grease.apply returns a "callable" object.

Contributing

You should follow the steps below.

  1. Fork the repository
  2. Create a feature branch: git checkout -b add-new-feature
  3. Commit your changes: git commit -am 'add new feature'
  4. Push the branch: git push origin add-new-feature
  5. Send us a pull request

We use Appraisal to test with different versions of Sprockets.

bundle install
appraisal install

# Run rspec with a specific version of Sprockets
appraisal sprockets4 rspec

# Run rspec with all versions of Sprockets
appraisal rspec

License

The gem is available as open source under the terms of the MIT License.