Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added rake task to generate concatenated and minified ext mvc files
- Loading branch information
Edward Spencer
committed
Oct 24, 2008
1 parent
ecbd312
commit 7a83683
Showing
2 changed files
with
73 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace(:ext_mvc) do | ||
|
||
desc "Creates ext-mvc-all.js and ext-mvc-all-min.js files (expects java to be installed and the yui-compressor to be located at ../yui-compressor" | ||
task :create_minified_files => :environment do | ||
concatenated_filename = "public/javascripts/ext/ux/mvc/ext-mvc-all.js" | ||
minified_filename = "public/javascripts/ext/ux/mvc/ext-mvc-all-min.js" | ||
|
||
#creates public/javascripts/ext/ux/mvc/ext-mvc-all.js | ||
ExtMvcRails::JavascriptExpansions.concatenate_and_minify | ||
|
||
#performs concatentation of ext-mvc-all.js to ext-mvc-all-min.js | ||
FileUtils.rm(minified_filename) if File.exists?(minified_filename) | ||
system("java -jar ../yui-compressor/build/yuicompressor-2.4.jar #{concatenated_filename} -o #{minified_filename}") | ||
end | ||
|
||
end |