How to use the opal-compiler.Builder.$new function in opal-compiler

To help you get started, we’ve selected a few opal-compiler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github asciidoctor / asciidoctor.js / npm / opal-compiler.js View on Github external
OpalCompiler.prototype.compile = function(require, outputFile, includes) {
  var builder = Builder.$new();
  builder.$append_paths('node_modules/opal-compiler/src/stdlib', 'lib', 'build/asciidoctor/lib');
  builder.compiler_options = Opal.hash({'dynamic_require_severity': this.dynamicRequireLevel});
  if (typeof includes !== 'undefined') {
    var includesLength = includes.length;
    for (var i = 0; i < includesLength; i++) {
      builder.$append_paths(includes[i]);
    }
  }
  log.debug('compile ' + require);
  var result = builder.$build(require);
  fs.writeFileSync(outputFile, result.$to_s(), 'utf8');
}

opal-compiler

Opal compiler

MIT
Latest version published 1 year ago

Package Health Score

40 / 100
Full package analysis