Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

assetbuild

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assetbuild

bundlerRubygems
Version
0.1.0
Version published
Maintainers
1
Created
Source

Builds, bundles, and minifies CSS and CoffeeScript files.

== Building CSS

require 'css-reader' css = CSSReader.new("test.css","secondary.css") css.save("production.css", :compress => true)

The above commands will generate new file that merges the files passed to the class in order. Also, and "@import" statement is processed inline and is also inserted in the order it is encountered recursively throughout the CSS. In this example the file has also been yui-compressed.

Alternatively, you can pass in additional css files at later point with the append method:

css = CSSReader.new("test.css")

do stuff...

css.append("secondary.css")

You could also run this from the command line:

buildcss public/stylesheets/main.css -c

Which will recursively process all imported files and then write a single minified CSS file to: public/stylesheets/main.build.min.css

== Building CoffeeScript

require 'coffee-bundler' js = CoffeeBundler.new("path/to/coffee/bundle") js.save("public/javascripts/bundle.min.js", :compress => true)

This will effectively bundle files that match: path/to/coffee/bundle/*.coffee

...into a single minified JS file located at: public/javascripts/bundle.min.js

No, this will not work unless you have coffee-script installed on your system!

== Dependencies

Requires the yui-compressor gem:

gem install -r yui-compressor

More info: http://github.com/sstephenson/ruby-yui-compressor

== Specs

A simple but comprehensive rSpec suite is provided for quality assurance purposes.

spec css_reader_spec.rb

== Disclaimer

This is really crude but useful. You could easily crash it if you placed an @import statement in a fashion to create an infinite loop. Don't do that! :)

FAQs

Package last updated on 08 Apr 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts