Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

The simplest assets compressor

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 etc
Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rvmrc.example
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 TODO.md
Octocat-spinner-32 evax.gemspec
README.md

Evax Assets Compressor

Evax compressor logo

Evax compressor make you feel lighter

Evax is a simple asset packaging library for Ruby, providing JavaScript/CSS concatenation and compression using UglifyJS and a really simple regex based CSS compressor. Just because enough is enough.

The idea behind it is to have a really simple library to compress your assets in the simplest way without any weird dependency (who said Java?). There are nice assets packaging systems out there but they have too many options for some cases.

Create a YAML file describing assets, Evax will take it and compress the javascript and stylesheets files to the output directory of your choice. Done.

Instalation

gem install evax

Dependencies

As Evax has a dependency in uglifier who has a dependency in execjs it is needed to have a proper JS runtime installed in your system. Pick one from the execjs README page

Usage

assets.yml

compress:    off # default on
output_path: tmp/

javascripts:
  js_package_one:
    - test/fixtures/javascripts/one.js
    - test/fixtures/javascripts/two.js
    - test/fixtures/javascripts/three.js
  js_package_two:
    - test/fixtures/javascripts/four.js

stylesheets:
  css_package_one:
    - test/fixtures/stylesheets/one.css
    - test/fixtures/stylesheets/two.css
  css_package_two:
    - test/fixtures/stylesheets/three.css
    - test/fixtures/stylesheets/four.css

Command Line

evax /path/to/assets.yml /base/path

or, for watchr mode:

evax /path/to/assets.yml /base/path -w

In watchr mode if any asset file is changed the group will be recompressed authomatically.

Rails

Add evax to your Gemfile:

gem 'evax'

Create a Rake task for running it, e.g.:

namespace :evax do
  ASSETS_PATH = "#{Rails.root}/config/assets.yml"
  BASE_PATH   = Rails.root

  desc 'Build assets'
  task :build do
    Evax.new( ASSETS_PATH, BASE_PATH ).build
  end
end
Something went wrong with that request. Please try again.