14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/scms/yui.rb', line 14
def Yui.compress(asset, ext)
if File.exists?(asset)
enc = "--charset utf-8"
enc = ""
cmd = "java"
params = "-jar \"#{File.join(Folders[:assets], "yuicompressor", "yuicompressor-2.4.7.jar")}\" #{enc} --type #{ext.gsub(".","")} \"#{asset}\" -o \"#{asset}\""
if system("#{cmd} #{params}")
ScmsUtils.log( "_Crunched #{File.basename(asset)}_" )
else
ScmsUtils.errLog( "Error crunching: #{asset}" )
end
else
ScmsUtils.errLog( "#{asset} does not exist" )
end
end
|