How to use opal-runtime - 8 common examples

To help you get started, we’ve selected a few opal-runtime 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 Mogztter / opal-node-compiler / src / index.js View on Github external
var Opal = require('opal-runtime').Opal;
require('./opal-builder.js');
require('./opal-source-maps.js');

Opal.require('nodejs');
Opal.require('opal-builder');
Opal.require('opal-source-maps');

/**
 * Convert a JSON to an (Opal) Hash.
 * @private
 */
var toHash = function (object) {
  if (object && !object.smap) {
    return Opal.hash(object);
  }
  return object;
};

var Builder = Opal.const_get_qualified(Opal.const_get_relative([], 'Opal'), 'Builder');
var ERB = Opal.const_get_qualified(Opal.const_get_relative([], 'Opal'), 'ERB');

// Public API
github Mogztter / opal-node-compiler / src / index.js View on Github external
Opal.require('opal-builder');
Opal.require('opal-source-maps');

/**
 * Convert a JSON to an (Opal) Hash.
 * @private
 */
var toHash = function (object) {
  if (object && !object.smap) {
    return Opal.hash(object);
  }
  return object;
};

var Builder = Opal.const_get_qualified(Opal.const_get_relative([], 'Opal'), 'Builder');
var ERB = Opal.const_get_qualified(Opal.const_get_relative([], 'Opal'), 'ERB');

// Public API

Builder['$$class'].prototype.create = function () {
  return this.$new();
};

Builder.prototype.appendPaths = function (paths) {
  this.$append_paths(paths);
};

Builder.prototype.setCompilerOptions = function (options) {
  this.compiler_options = toHash(options);
};

Builder.prototype.build = function (path, options) {
github Mogztter / opal-node-compiler / src / index.js View on Github external
Opal.require('nodejs');
Opal.require('opal-builder');
Opal.require('opal-source-maps');

/**
 * Convert a JSON to an (Opal) Hash.
 * @private
 */
var toHash = function (object) {
  if (object && !object.smap) {
    return Opal.hash(object);
  }
  return object;
};

var Builder = Opal.const_get_qualified(Opal.const_get_relative([], 'Opal'), 'Builder');
var ERB = Opal.const_get_qualified(Opal.const_get_relative([], 'Opal'), 'ERB');

// Public API

Builder['$$class'].prototype.create = function () {
  return this.$new();
};

Builder.prototype.appendPaths = function (paths) {
  this.$append_paths(paths);
};

Builder.prototype.setCompilerOptions = function (options) {
  this.compiler_options = toHash(options);
};
github Mogztter / opal-node-compiler / spec / main.spec.js View on Github external
const chai = require('chai');
const expect = chai.expect;

const Opal = require('opal-runtime').Opal;
const Builder = require('../src/index').Builder;
const ERB = require('../src/index').ERB;

describe('Opal Node Compiler', function () {

  describe('When loaded', function() {
    it('should export Opal object', function() {
      expect(Opal).not.be.null;
    });

    it('should export Builder object', function() {
      expect(Builder).not.be.null;
    });
  });

  describe('Builder', function() {
github Mogztter / opal-node-compiler / src / index.js View on Github external
var toHash = function (object) {
  if (object && !object.smap) {
    return Opal.hash(object);
  }
  return object;
};
github Mogztter / opal-node-compiler / src / index.js View on Github external
var Opal = require('opal-runtime').Opal;
require('./opal-builder.js');
require('./opal-source-maps.js');

Opal.require('nodejs');
Opal.require('opal-builder');
Opal.require('opal-source-maps');

/**
 * Convert a JSON to an (Opal) Hash.
 * @private
 */
var toHash = function (object) {
  if (object && !object.smap) {
    return Opal.hash(object);
  }
  return object;
};

var Builder = Opal.const_get_qualified(Opal.const_get_relative([], 'Opal'), 'Builder');
var ERB = Opal.const_get_qualified(Opal.const_get_relative([], 'Opal'), 'ERB');
github Mogztter / opal-node-compiler / src / index.js View on Github external
var Opal = require('opal-runtime').Opal;
require('./opal-builder.js');
require('./opal-source-maps.js');

Opal.require('nodejs');
Opal.require('opal-builder');
Opal.require('opal-source-maps');

/**
 * Convert a JSON to an (Opal) Hash.
 * @private
 */
var toHash = function (object) {
  if (object && !object.smap) {
    return Opal.hash(object);
  }
  return object;
};

var Builder = Opal.const_get_qualified(Opal.const_get_relative([], 'Opal'), 'Builder');
var ERB = Opal.const_get_qualified(Opal.const_get_relative([], 'Opal'), 'ERB');
github Mogztter / opal-node-compiler / src / index.js View on Github external
var Opal = require('opal-runtime').Opal;
require('./opal-builder.js');
require('./opal-source-maps.js');

Opal.require('nodejs');
Opal.require('opal-builder');
Opal.require('opal-source-maps');

/**
 * Convert a JSON to an (Opal) Hash.
 * @private
 */
var toHash = function (object) {
  if (object && !object.smap) {
    return Opal.hash(object);
  }
  return object;

opal-runtime

Opal Runtime

MIT
Latest version published 2 years ago

Package Health Score

39 / 100
Full package analysis