0.0
No commit activity in last 3 years
No release in over 3 years
Add sprockets to your roger project
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0

Runtime

 Project Readme

RogerSprockets

Add sprockets to your roger project.

Sprockets is a Ruby library for compiling and serving web assets. It features declarative dependency management for JavaScript and CSS assets, as well as a powerful preprocessor pipeline that allows you to write assets in languages like CoffeeScript, Sass and SCSS.

Installation

Add this line to your application's Gemfile:

gem "roger_sprockets"

And then execute:

$ bundle

Usage

Add the following lines to your Mockupfile

For serving with sprockets

mockup.serve do |s|
    s.use(RogerSprockets::Middleware)
end

For making a release

mockup.release do |r|    
    r.use(RogerSprockets::Processor)
end

Registering additional engines

require 'sprockets'
require 'mustache/js'
require 'tilt/mustache_js_template'

sprockets = Sprockets::Environment.new()
sprockets.register_engine '.mustache', Tilt::MustacheJsTemplate

mockup.serve do |s|
    s.use(RogerSprockets::Middleware, :sprockets_environment => sprockets)
end

Options

[:sprockets_environment], Pass a custom sprockets environment, in which you can register an additional enginge or tweak sprockets more to your need. See [registering-additional-engines].

[:load_paths], Add additional loading paths. Defaults: ["html/javascripts"]

Processor

[:build_files], Define which files roger_sprockets should build. Defaults: ["html/javascripts/site.js"]

[:clean], roger_sprockets can clean your dependencies after you made a build. Pass true to let it remove all dependencies.

TODO

  • Add test coverage (especially on some edge cases)
  • Add asset fingerprinting

Contributing

  1. Fork it ( https://github.com/[my-github-username]/roger_sprockets/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request