Module OpenLaszlo
In: lib/openlaszlo/applet.rb
lib/openlaszlo/compiler.rb

module OpenLaszlo

This module contains utility methods for compiling OpenLaszlo programs.

Example:

  # Set up the environment to use the compile server.  The OpenLaszlo server
  # must be running in order at this location in order for this to work.
  ENV['OPENLASZLO_HOME'] = '/Applications/OpenLaszlo Server 3.1'
  ENV['OPENLASZLO_URL'] = 'http://localhost:8080/lps-3.1'

  require 'openlaszlo'
  # Create a file 'hello.swf' in the current directory:
  OpenLaszlo::compile 'hello.lzx'

See OpenLaszlo.compile for additional documentation.

Methods

compile   compiler   compiler=  

Classes and Modules

Class OpenLaszlo::Applet
Class OpenLaszlo::CommandLineCompiler
Class OpenLaszlo::CompilationError
Class OpenLaszlo::CompileServer
Class OpenLaszlo::InvalidSourceLocation

Public Class methods

Compile an OpenLaszlo source file.

Examples:

  require 'openlaszlo'
  OpenLaszlo::compile 'hello.lzx'
  OpenLaszlo::compile 'hello.lzx', :debug => true
  OpenLaszlo::compile 'hello.lzx', :runtime => 'swf8'
  OpenLaszlo::compile 'hello.lzx', :runtime => 'swf8', :debug => true
  OpenLaszlo::compile 'hello.lzx', :output => 'hello-world.swf'

Options are:

  • :debug - debug mode (default false)
  • :output - specify the name and location for the output file (default = input_file.sub(/\.lzx$/, ’.swf’))
  • :proxied - is application proxied (default true)
  • :runtime - runtime (default swf8)

See CompileServer.compile and CommandLineCompiler.compile for additional options that are specific to the compilation methods in those classes.

[Source]

     # File lib/openlaszlo/compiler.rb, line 258
258:   def self.compile(source_file, options={})
259:     options = options.clone
260:     options[:runtime] ||= 'swf8'
261:     compiler.compile(source_file, options)
262:   rescue InvalidSourceLocation
263:     CommandLineCompiler.new.compile(source_file, options)
264:   end

Returns the default compiler. Use the server-based compiler if it‘s available, since it‘s so much faster.

[Source]

     # File lib/openlaszlo/compiler.rb, line 220
220:   def self.compiler
221:     return @compiler if @compiler
222:     return @compiler = CompileServer.new if ENV['OPENLASZLO_URL'] and ENV['OPENLASZLO_HOME']
223:     return @compiler = CommandLineCompiler.new if ENV['OPENLASZLO_HOME']
224:     raise "Couldn\\'t find an OpenLaszlo compiler.\n\nTo use the compile server (recommended), set ENV['OPENLASZLO_URL'] and ENV['OPENLASZLO_HOME'].\n\nTo use the command-line compiler, set ENV['OPENLASZLO_HOME'].\n"
225:   end

Sets the default compiler for future invocations of OpenLaszlo.compile.

[Source]

     # File lib/openlaszlo/compiler.rb, line 235
235:   def self.compiler= compiler
236:     @compiler = compiler
237:   end

[Validate]