Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yasaichi/grease
:nail_care: Tilt adapter for Sprockets 3 or later
https://github.com/yasaichi/grease
rails sprockets tilt
Last synced: about 1 month ago
JSON representation
:nail_care: Tilt adapter for Sprockets 3 or later
- Host: GitHub
- URL: https://github.com/yasaichi/grease
- Owner: yasaichi
- License: mit
- Created: 2016-09-09T04:20:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T05:26:13.000Z (about 1 year ago)
- Last Synced: 2024-11-19T21:25:28.261Z (about 2 months ago)
- Topics: rails, sprockets, tilt
- Language: Ruby
- Homepage:
- Size: 56.6 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Grease
[![Gem Version](https://badge.fury.io/rb/grease.svg)](http://badge.fury.io/rb/grease)
[![Build Status](https://travis-ci.org/yasaichi/grease.svg?branch=master)](https://travis-ci.org/yasaichi/grease)
[![Code Climate](https://codeclimate.com/github/yasaichi/grease/badges/gpa.svg)](https://codeclimate.com/github/yasaichi/grease)
[![Test Coverage](https://codeclimate.com/github/yasaichi/grease/badges/coverage.svg)](https://codeclimate.com/github/yasaichi/grease/coverage)Grease provides an adapter to use [Tilt](https://github.com/rtomayko/tilt) as extension of Sprockets 3 or later.
## Installation
Add this line to your application's Gemfile:
```ruby
gem "grease"
```And then execute:
```shell
$ bundle
```Or install it yourself as:
```shell
$ gem install grease
```## Usage
When you'd like to use `Tilt::HamlTemplate` in Sprockets, add code like this:
```ruby
# 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](https://help.github.com/articles/fork-a-repo/)
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`
4. [Send us a pull request](https://help.github.com/articles/using-pull-requests/)We use [Appraisal](https://github.com/thoughtbot/appraisal) to test with different versions of Sprockets.
```shell
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](http://opensource.org/licenses/MIT).