Class: Jscompiler::Commands::Closure
- Inherits:
-
Base
- Object
- Base
- Jscompiler::Commands::Closure
show all
- Defined in:
- lib/jscompiler/commands/closure.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
Instance Method Details
#args ⇒ Object
33
34
35
36
37
38
39
|
# File 'lib/jscompiler/commands/closure.rb', line 33
def args
[
["--js", temp_file_path],
["--js_output_file", output_file_path],
["--warning_level", Jscompiler::Config.compiler["warning_level"] || "DEFAULT"]
]
end
|
#compiler_path ⇒ Object
29
30
31
|
# File 'lib/jscompiler/commands/closure.rb', line 29
def compiler_path
File.expand_path(File.join(File.dirname(__FILE__), "../../../vendor/closure/compiler.jar"))
end
|
#run ⇒ Object
41
42
43
44
45
|
# File 'lib/jscompiler/commands/closure.rb', line 41
def run
generate_temp_file
execute(prepare_command("java -jar #{compiler_path}", args))
save_or_delete_temp_file
end
|