https://github.com/coryodaniel/ruby-yui
Ruby wrapper for the YUI Compressor.
https://github.com/coryodaniel/ruby-yui
Last synced: 3 months ago
JSON representation
Ruby wrapper for the YUI Compressor.
- Host: GitHub
- URL: https://github.com/coryodaniel/ruby-yui
- Owner: coryodaniel
- Created: 2008-12-15T09:13:31.000Z (over 17 years ago)
- Default Branch: master
- Last Pushed: 2009-06-08T22:10:20.000Z (about 17 years ago)
- Last Synced: 2025-04-10T04:12:37.821Z (about 1 year ago)
- Language: JavaScript
- Homepage: http://github.com/coryodaniel/ruby-yui
- Size: 957 KB
- Stars: 12
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: CHANGELOG
Awesome Lists containing this project
README
ruby-yui is a ruby wrapper for the YUI Compressor.
==== Install Thor Tasks
thor install http://github.com/coryodaniel/ruby-yui/raw/master/task.thor
==== Usage
# this also takes a options hash, defaults are stated below
yui = Yui.new "./path/to/javascripts"
yui = Yui.new "./path/to/javascripts", :out_path => "./public/javascripts"
yui = Yui.new "./path/to/javascripts/application.js"
yui = Yui.new "./path/to/javascripts/*.my.cool.glob.*.js"
# to compress
yui.minify
Yui.compress_string("alert('hello world');")
# => true|false if 100% of files where minified
# to compress & bundle
yui.bundle
# => path to bundle OR nil if failed to bundle
==== Quick Usage
# This does the same thing as instantiating a Yui object and calling minify
# it also takes the same params hash
Yui.compress "./test/data/javascripts"
# => true|false
==== Default Options
:clobber => false,
:java_cli => "java -jar",
:yui_jar => File.join(YUI_ROOT,"ext","yuicompressor-2.4.2.jar"),
:suffix => "yui-min",
:out_path => nil, #file_path.sub(inpath,outpath)
:type => :js,
:charset => nil,
:preserve_semi => false,
:disable_opt => false,
:nomunge => false