Skip to content

Instantly share code, notes, and snippets.

@mxriverlynn
Created January 7, 2010 22:47
Show Gist options
  • Save mxriverlynn/271679 to your computer and use it in GitHub Desktop.
Save mxriverlynn/271679 to your computer and use it in GitHub Desktop.
yet another reason that I love ruby / rake, vs nant
<target name="compress.css" verbose="true" description="compress the css files">
<foreach item="File" property="file.path">
<in>
<items>
<include name="css\*.css" />
</items>
</in>
<do>
<property name="filename" value="css\${path::get-file-name(file.path)}" />
<exec program="java" commandline="-jar ${tools}\YUICompressor\build\yuicompressor-2.4.2.jar --type css -o ${filename} ${filename}" />
</do>
</foreach>
</target>
Dir.glob("css/*.css") do |f|
filename = File.basename(f)
system "java -jar ${tools}\YUICompressor\build\yuicompressor-2.4.2.jar --type css -o ${filename} ${filename}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment