Sha256: 355e27d6bb959ea5ed2667c6ac431e36c66caa18ee9fd7e013cf239e5fea873d

Contents?: true

Size: 1.44 KB

Versions: 3

Compression:

Stored size: 1.44 KB

Contents

// All functionality here is not run in the browser.. it is just loaded in the 
// ruby env (in opal etc), so replicates all the methods from browser.js

// load the raw file, given as a function imolementation as the given filename
// 
// @param [String] filename
// @param [Function] implementation
exports.load_raw_file = function(filename, implementation) {
  // console.log("running " + filename);
  return implementation.apply(exports.top_self);
};

// Are we ever going to load browser opal? in case we do
exports.setDocumentReadyListener = function(callback) {

};

exports.getwd = __opal_fs_access.getwd();

// require the file at the given path: we have already checked it exists - mark
// as being required - execute in context of top_self
// 
// params function(__FILE__) { .. }
var file_require_path = function(path) {
  // console.log("requiring " + path);
  var f = file_list[path];
  f.opal_required = true;
  return f.apply(exports.top_self, [path]);
};

exports.require = function(orig_path) {
  if(__opal_fs_access.require(orig_path)) {
    return vnTrue;
  } else {
    throw "cannot find require: " + orig_path;
  };
};

exports.glob_files = function(glob) {
  return __opal_fs_access.glob(glob);
};

// When "server side", our RUBY_PLATFORM is just 'opal'.. browser sets it to
// 'browser'.
exports.ruby_platform = "opal";

// Should we keep in line with mri? we support some 1.9 features, but not all..
// ... hmmm.
exports.ruby_version = "1.9.0";

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opal-0.2.2 opals/opal/runtime/runtime/server_side.js
opal-0.2.0 opals/opal/runtime/runtime/server_side.js
opal-0.1.0 opals/runtime/runtime/server_side.js