Project

minit

0.0
No commit activity in last 3 years
No release in over 3 years
Minify CSS and JS without requiring Java nor specifying individual files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

>= 0
>= 0
 Project Readme

Minit!

Minify JS and CSS in all environments except development and test for Ruby on Rails apps. (so far tested on Rails 3 but will be testing on Rails 2 in the coming days)

No frills, no configuration, opinionated packager. Use it, fork it or use something else.

This gem aims to fix two shortcomings in the main two asset packaging libraries, namely:

  1. Jammit requires Java to package CSS
  2. asset_packager requires a configuration file to specify every single CSS or JS file

It uses CSSMin and JSMin gems from rgrove. Thanks!

It will ignore files that don't exist. It will only include files once.

It's about 50 lines of code.

Usage

gem install minit

In your layout file add the following to <head>:

= include_stylesheets
= include_javascripts

Then ensure this folder structure to get the correct load order:

public/
  javascripts/
    lib/
      jquery.js (for example)
    plugins/
      jquery_ui/ (for example)
        jquery.menu.js (for example)
    application.js (your own JS for example)

  stylesheets/
    reset.css
    default.css
    application.css
    lib/
      *
    *

Status / Todo

First release

This was hacked together one afternoon as I was fed up seeing the error message that Jammit couldn't compress because Java wasn't installed on our server. I wanted to see if it was easy enough to put together a simpler solution.

Feel free to report bugs in Issues.

Development

Minit uses MiniSpec, FakeFS, Watchr, RVM.