Permalink
Browse files

Make the test work on all target platforms and list these platforms i…

…n README.
  • Loading branch information...
1 parent bc92996 commit 8ac69000b63eda68e51ef1b66c8f4081976ed1be @jcoglan committed May 27, 2012
Showing with 34 additions and 16 deletions.
  1. +13 −3 README.markdown
  2. +11 −9 src/exports.js
  3. +8 −4 test/console.js
  4. +2 −0 test/runner.js
View
@@ -21,16 +21,26 @@ To build the library from source:
To test, run using various JS binaries and open the tests in the browser:
- node test/console.js
v8 test/console.js
+ node test/console.js
+
rhino test/console.js
- # etc
+ narwhal test/console.js
+ ringo test/console.js
+
+ spidermonkey test/console.js # or `js test/console.js`
+
+ cscript.exe test/console.js # on Windows
open test/browser.html
To view the website locally:
- staticmatic preview site
+ bundle exec staticmatic preview site
+
+To build the static files for the website:
+
+ bundle exec staticmatic build site
## License
View
@@ -1,9 +1,11 @@
-if (typeof require === 'function' && typeof module === 'object') {
- module.exports = Sylvester;
-} else {
- this.Line = Sylvester.Line;
- this.Matrix = Sylvester.Matrix;
- this.Plane = Sylvester.Plane;
- this.Polygon = Sylvester.Polygon;
- this.Vector = Sylvester.Vector;
-}
+(function() {
+ var api = (typeof require === 'function' && typeof exports === 'object')
+ ? exports
+ : this;
+
+ api.Line = Sylvester.Line;
+ api.Matrix = Sylvester.Matrix;
+ api.Plane = Sylvester.Plane;
+ api.Polygon = Sylvester.Polygon;
+ api.Vector = Sylvester.Vector;
+})();
View
@@ -8,13 +8,17 @@ if (this.ActiveXObject)
} finally {
try { if (file) file.Close() } catch (e) {}
}
- }
+ };
-JSCLASS_PATH = 'node_modules/jsclass/src'
+(function() {
+ var $ = (typeof global === 'object') ? global : this
+ $.JSCLASS_PATH = 'node_modules/jsclass/src'
+})()
if (typeof require === 'function') {
- Sylvester = require('../lib/sylvester')
- require('jsclass')
+ require('../' + JSCLASS_PATH + '/loader')
+ JS.ENV.Sylvester = require('../lib/sylvester')
+ Sylvester.precision = 1e-6
require('./runner')
}
else {
View
@@ -1,3 +1,5 @@
+JS.cacheBust = true
+
JS.Packages(function() { with(this) {
var ROOT = JS.ENV.ROOT || '.'
autoload(/.*Spec$/, {from: ROOT + '/test/specs', require: 'JS.Test'})

0 comments on commit 8ac6900

Please sign in to comment.