Skip to content

Commit

Permalink
use latest rcu
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jun 2, 2014
1 parent 8ae0806 commit 523a212
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 367 deletions.
2 changes: 1 addition & 1 deletion grunt/config/requirejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
paths: {
'amd-loader': '../vendor/amd-loader',
'tosource': '../vendor/tosource',
'rcu.amd': '../vendor/rcu.amd'
'rcu': '../node_modules/rcu/rcu.amd'
},
logLevel: 2,
onBuildWrite: function( name, path, contents ) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"jit-grunt": "~0.4.1",
"requirejs": "~2.1.13",
"ractive": "~0.4.0",
"rcu": "~0.1.5"
"rcu": "~0.1.6"
}
}
51 changes: 12 additions & 39 deletions rvc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
rvc.js - v0.1.6 - 2014-06-01
rvc.js - v0.1.7 - 2014-06-02
==========================================================
https://github.com/ractivejs/rvc
Expand Down Expand Up @@ -205,7 +205,7 @@ define( [ 'ractive'

/*
rcu (Ractive component utils) - 0.1.4 - 2014-06-01
rcu (Ractive component utils) - 0.1.5 - 2014-06-02
==============================================================
Copyright 2014 Rich Harris and contributors
Expand Down Expand Up @@ -288,32 +288,23 @@ define( [ 'ractive'
}( getName );
/*
eval2.js - 0.1.5 - 2014-06-01
eval2.js - 0.1.5 - 2014-06-02
==============================================================
Copyright 2014 Rich Harris
Released under the MIT license.
*/
var eval2 = function() {
var _eval, isBrowser, isNode, _nodeRequire, _dir, head, Module, useFs, fs, path;
var _eval, isBrowser, isNode, head, Module;
// This causes code to be eval'd in the global scope
_eval = eval;
if ( typeof document !== 'undefined' ) {
isBrowser = true;
head = document.getElementsByTagName( 'head' )[ 0 ];
} else if ( typeof process !== 'undefined' ) {
isNode = true;
if ( typeof module !== 'undefined' && typeof module._compile === 'function' ) {
Module = module.constructor;
} else {
// Special case - we're possibly using RequireJS in node
useFs = true;
_nodeRequire = require.nodeRequire;
fs = _nodeRequire( 'fs' );
path = _nodeRequire( 'path' );
_dir = typeof __dirname !== 'undefined' ? __dirname : path.resolve( path.dirname( module.uri ) );
}
Module = ( require.nodeRequire || require )( 'module' );
}

function eval2( script, options ) {
Expand Down Expand Up @@ -359,32 +350,14 @@ define( [ 'ractive'
}

function locateErrorUsingModule( code, url ) {
var m, x, wrapped, name, filepath;
if ( useFs ) {
wrapped = 'module.exports = function () {\n' + code + '\n};';
name = '__eval2_' + Math.floor( Math.random() * 100000 ) + '__';
filepath = path.join( _dir, name + '.js' );
fs.writeFileSync( filepath, wrapped );
try {
x = _nodeRequire( filepath );
} catch ( err ) {
console.error( err );
fs.unlinkSync( filepath, wrapped );
return;
}
fs.unlinkSync( filepath, wrapped );
x();
} else {
m = new Module();
try {
m._compile( 'module.exports = function () {\n' + code + '\n};', url );
} catch ( err ) {
console.error( err );
return;
}
x = m.x;
var m = new Module();
try {
m._compile( 'module.exports = function () {\n' + code + '\n};', url );
} catch ( err ) {
console.error( err );
return;
}
x();
m.exports();
}
return eval2;
}();
Expand Down
2 changes: 1 addition & 1 deletion src/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define([
'rcu.amd',
'rcu',
'tosource',
'minifycss'
], function (
Expand Down
2 changes: 1 addition & 1 deletion src/load.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define([
'rcu.amd'
'rcu'
], function (
rcu
) {
Expand Down
2 changes: 1 addition & 1 deletion src/rvc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define([
'amd-loader',
'rcu.amd',
'rcu',
'load',
'build'
], function (
Expand Down
2 changes: 1 addition & 1 deletion test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
paths: {
'ractive': '../test/vendor/ractive/ractive',
'amd-loader': '../vendor/amd-loader',
'rcu.amd': '../vendor/rcu.amd',
'rcu': '../node_modules/rcu/rcu.amd',
'tosource': '../vendor/tosource',

'samples': '../test/samples'
Expand Down
Loading

0 comments on commit 523a212

Please sign in to comment.