Class: Fusion::Optimized
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from Basic
#gather_files, #get_output_file, #get_remote_file, #initialize, #run
Constructor Details
This class inherits a constructor from Fusion::Basic
Instance Method Details
#bundle(config) ⇒ Object
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/fusion.rb', line 154 def bundle(config) = [] << ["js_output_file", get_output_file(config)] << ["compilation_level", "SIMPLE_OPTIMIZATIONS"] << ["language_in","ECMASCRIPT5"] # This will be compatible w all newer browsers, and helps us avoid old IE quirks gather_files(config).each do |input_file| << ["js", input_file] end .collect! do |option| "--#{option[0]} #{option[1]}" end jar_file = File.join(__FILE__.split("/")[0..-3].join("/"), "/compiler/compiler.jar") cmd = "java -jar #{jar_file} #{.join(" ")}" io = IO.popen(cmd, "w") io.close raise Exception.new("Error creating bundle: #{get_output_file(config)}") unless $?.exitstatus == 0 end |