Class: Fusion::Optimized

Inherits:
Basic
  • Object
show all
Defined in:
lib/optimized.rb

Direct Known Subclasses

AdvancedOptimized, Pretty

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

Raises:

  • (Exception)


4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/optimized.rb', line 4

def bundle(config)
  options = get_options(config)

  jar_file = File.join(__FILE__.split("/")[0..-3].join("/"), "/compiler/compiler.jar")
  cmd = "java -jar #{jar_file} #{options.join(" ")}"
  io = IO.popen(cmd, "w")
  io.close

  raise Exception.new("Error creating bundle: #{get_output_file(config)}") unless $?.exitstatus == 0

  File.read(get_output_file(config))
end