Class: Jscompiler::Commands::Yahoo

Inherits:
Base
  • Object
show all
Defined in:
lib/jscompiler/commands/yahoo.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#comments_regexp, compile_group, #debug_file_path, #execute, #generate_temp_file, #group, #initialize, #output_file_path, #prepare_arguments, #prepare_command, #sanitize, #save_or_delete_temp_file, #temp_file_path

Constructor Details

This class inherits a constructor from Jscompiler::Commands::Base

Instance Method Details

#argsObject



33
34
35
36
37
# File 'lib/jscompiler/commands/yahoo.rb', line 33

def args 
  [
    ["-o", output_file_path],
  ]
end

#compiler_pathObject



29
30
31
# File 'lib/jscompiler/commands/yahoo.rb', line 29

def compiler_path
  File.expand_path(File.join(File.dirname(__FILE__), "../../../vendor/yahoo/yuicompressor-2.4.2.jar"))
end

#runObject



39
40
41
42
43
# File 'lib/jscompiler/commands/yahoo.rb', line 39

def run
  generate_temp_file
  execute("java -jar #{compiler_path} #{prepare_arguments(args)} #{temp_file_path}")
  save_or_delete_temp_file
end