Riassence JSMin Wrapper
Description:
This is a ruby -> c wrapper extension for Douglas Crockford’s awesome jsmin. It’s just as fast as the original (orders of magnitude faster than the pure ruby version in the ‘jsmin’ gem). This used to be a fixed part of the Riassence Framework, but it’s distributed as a separate gem now.
Known issues:
Don’t use the (slow) pure ruby version of jsmin in combination with jsmin_c
Usage:
require 'jsmin_c'
# Makes a JSMin instance that removes white space from js source.
jsmin = JSMin.new
js1 = File.read( 'big_js1.js' )
minimized_js1 = jsmin.minimize( js1 )
js2 = File.read( 'big_js2.js' )
minimized_js2 = jsmin.minimize( js2 )
Install:
-
sudo gem install jsmin
License:
Ruby extension by: Domen Puncer <[email protected]>
jsmin.c
2008-08-03
Copyright © 2002 Douglas Crockford (www.crockford.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.