Sha256: a85d7e1442fe56896979d82298ed0509115a87509b244d8771872fb3320697a6
Contents?: true
Size: 1.79 KB
Versions: 1
Compression:
Stored size: 1.79 KB
Contents
(function() { if (!this.require) { var modules = {}, cache = {}; var require = function(name, root) { var path = expand(root, name), indexPath = expand(path, './index'), module, fn; module = cache[path] || cache[indexPath]; if (module) { if (module.__define_in_progress) { throw new Error("Circular dependency: " + name + " already required."); } return module; } else if (fn = modules[path] || modules[path = indexPath]) { module = {id: path, exports: { __define_in_progress: true } }; cache[path] = module.exports; fn(module.exports, function(name) { return require(name, dirname(path)); }, module); delete module.exports.__define_in_progress; return cache[path] = module.exports; } else { throw 'module ' + name + ' not found'; } }; var expand = function(root, name) { var results = [], parts, part; // If path is relative if (/^\.\.?(\/|$)/.test(name)) { parts = [root, name].join('/').split('/'); } else { parts = name.split('/'); } for (var i = 0, length = parts.length; i < length; i++) { part = parts[i]; if (part == '..') { results.pop(); } else if (part != '.' && part != '') { results.push(part); } } return results.join('/'); }; var dirname = function(path) { return path.split('/').slice(0, -1).join('/'); }; this.require = function(name) { return require(name, ''); }; this.require.define = function(bundle) { for (var key in bundle) { modules[key] = bundle[key]; } }; this.require.modules = modules; this.require.cache = cache; } return this.require; }).call(this);
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sprockets-commonjs-mindreframer-0.1.0 | assets/sprockets/commonjs.js |