Module: Opal::CliRunners

Defined in:
opal/lib/opal/cli_runners.rb,
opal/lib/opal/cli_runners/nodejs.rb,
opal/lib/opal/cli_runners/server.rb,
opal/lib/opal/cli_runners/nashorn.rb,
opal/lib/opal/cli_runners/phantomjs.rb,
opal/lib/opal/cli_runners/applescript.rb

Overview

Opal::CliRunners is the namespace in which JavaScript runners can be defined for use by Opal::CLI. The API for classes defined under CliRunners is the following.

  • The #initialize method takes an Hash containing an output: object. Additional keys can be safely ignored and can be specific to a particular runner, e.g. the CliRunners::Server runner will accepts a port: option.
  • The runner instance will then be called via #run(compiled_source, argv):
    • compiled_source is a string of JavaScript code
    • argv is the arguments vector coming from the CLI that is being forwarded to the program

Defined Under Namespace

Classes: Applescript, Nashorn, Nodejs, Phantomjs, RunnerError, Server