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.

Methods

compile   new  

Public Class methods

Options:

  • :openlaszlo_home - filesystem location of the OpenLaszlo SDK. Defaults to EVN[‘OPENLASZLO_HOME’]
  • :server_uri - the URI of the server. Defaults to ENV[‘OPENLASZLO_URL’] if this is specified, otherwise to ‘localhost:8080/lps-dev’.

[Source]

    # 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

Public Instance methods

Invokes the OpenLaszlo server-based compiler on source_file. source_file must be inside the home directory of the server.

Options:

  • :format - request type (default ‘swf’)

See OpenLaszlo.compile for a description of options.

[Source]

    # 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

[Validate]