Project

strockets

0.0
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Use Stitch allong with Sprockets
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 2.0.0
 Project Readme

Strockets

Use Stitch allong with Sprockets

Warning

This is currently under revision so the gem's API might change but at this state is very less likely

Installation

Rails 3.1

Just include this gem in your Gemfile

# Gemfile
gem 'strockets'

Others

Add the gem to your Gemfile and register Strockets on your sprockets environment:

# Gemfile
gem 'strockets'

# initializer_file.rb
env.append_path Strockets.stitch_path
env.register_postprocessor(
  'application/javascript',
  Strockets::StitchPostprocessor
)

Usage

By default Strockets will Stitch every file excluding application.js, templates and those inside a vendor directory or a gem.

But you can force the stitching of a file by adding a directive to your file's header like

//= stitch true|false

Configuration

Strockets has the following options:

  • Strockets.namespace: Which namespace to use
  • Strockets.defaults_to_stitch: Default Action (to stitch or not to stitch)
  • Strockets.stitch_exceptions: Which files shouldn't follow the default action