| Class | OpenLaszlo::CompileServer |
| In: |
lib/openlaszlo/compiler.rb
|
| Parent: | Object |
This class implements a bridge to the compile server.
If you don‘t need multiple compilers, you can use the methods in the OpenLaszlo module instead.
CompileServer is faster than CommandLineCompiler, but can only compile files in the same directory as the OpenLaszlo SDK.
Options:
# File lib/openlaszlo/compiler.rb, line 37
37: def initialize(options={})
38: @home = options[:home] || ENV['OPENLASZLO_HOME']
39: @base_url = options[:server_uri] || ENV['OPENLASZLO_URL'] || 'http://localhost:8080/lps-dev'
40: end
Invokes the OpenLaszlo server-based compiler on source_file. source_file must be inside the home directory of the server.
Options:
See OpenLaszlo.compile for a description of options.
# File lib/openlaszlo/compiler.rb, line 49
49: def compile(source_file, options={})
50: mtime = File.mtime source_file
51: output = options[:output] || "#{File.expand_path(File.join(File.dirname(source_file), File.basename(source_file, '.lzx')))}.swf"
52: compile_object source_file, output, options
53: results = request_metadata_for source_file, options
54: raise "Race condition: #{source_file} was modified during compilation" if mtime != File.mtime(source_file)
55: results[:output] = output
56: raise CompilationError.new(results[:error]) if results[:error]
57: return results
58: end