Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Finishing up some of the little things

  • Loading branch information...
commit a960403d93b16fc28073796fba0b94cc8c417bce 1 parent 170a39c
@foobarfighter authored
View
40 Jakefile
@@ -5,7 +5,7 @@ var fs = require('fs')
, PacMan = require('./build/pacman').PacMan;
var generateBrowserSuite = function (){
- console.log('calling generateBrowserSuite');
+ console.log('--> generating browser suite');
var files = [];
files = files.concat(fsh.findSync(__dirname + '/spec/shared', /.*_spec.js$/));
@@ -21,10 +21,6 @@ var generateBrowserSuite = function (){
fs.writeFileSync(__dirname + '/spec/browser/autogen_suite.js', content);
};
-var restartLoaderService = function (){
- console.log('calling restartLoaderService');
-};
-
desc('Run foounit node specs');
namespace('spec', function (){
@@ -46,7 +42,6 @@ namespace('spec', function (){
task('browser', ['build:all'], function (){
generateBrowserSuite();
- restartLoaderService();
});
task('server', ['build:all'], function (){
@@ -109,49 +104,46 @@ namespace('build', function (params) {
fs.writeFileSync('templates/browser-node/foounit/foounit-browser.js', concated);
});
- desc('Build the server bundle');
- task('server', ['build:core'], function (param){
- console.log('--> Building foounit-server.js');
- var concated = pacman.concat('foounit-server.js');
- fs.writeFileSync('dist/foounit-server.js', concated);
- });
-
desc('Builds all adapter environments');
- task('all', ['build:core', 'build:browser', 'build:server'], function (){
+ task('all', ['build:core', 'build:browser'], function (){
console.log('--> Built all adapters');
});
});
namespace('site', function (){
- desc('Update generator templates and package bundles for the website');
- task('update', ['build:all'], function (){
+ var checkVersion = function (){
var version = process.env.VERSION;
if (!version){
throw new Error('Could not package without VERSION environment variable');
}
+ return version;
+ }
+ desc('generate', ['build:all'], function (){
console.log('--> generating website');
+ var version = checkVersion();
+
exec('cd site/www && docpad generate',
function (error, stdout, stderr){
var files = fsh.findSync(__dirname + '/site/www/out', /\.(html|js)$/);
+
for (var i = 0, ii = files.length; i < ii; ++i){
var content = fs.readFileSync(files[i]);
- content.toString().replace(/\$version/, version);
+ content = content.toString().replace(/\$version/g, version);
fs.writeFileSync(files[i], content);
+ console.log('--> replaced content in: ', files[i]);
}
- });
- //log('packaging ' + srcpkg);
-
- //var srcpkg = 'foounit-' + version + '-src.tar.gz'
- //exec('tar cvfz ' + srcpkg + ' *', function (error){
- // if (error){ throw new Error('Error while packaging: ', error); }
- //});
+ complete();
+ });
+ }, true);
+ desc('Update generator templates and package bundles for the website');
+ task('update', ['build:all', 'site:generate'], function (){
});
});
View
3  LICENSE.md
@@ -0,0 +1,3 @@
+foounit is distributed under the Dojo License.
+
+Go here for more details: http://dojotoolkit.org/license
View
10 build/build.json
@@ -16,13 +16,6 @@
, "src/mock/screw_compat.js"
]
- , "foounit-node.js": [
- { "file": "build/fsh.js", "scope": "function", "variable": "fsh" }
- , { "file": "src/adapters/node/assert_patch.js", "scope": "function", "variable": "assertPatch" }
- , "src/adapters/node/colors.js"
- , "src/adapters/node.js"
- ]
-
, "foounit-browser.js": [
"src/adapters/browser/json2.js"
, "src/adapters/browser/ui.js"
@@ -32,7 +25,4 @@
, "src/adapters/browser.js"
]
- , "foounit-server.js": [
- "src/server.js"
- ]
}
View
2  site/www/src/documents/about.html
@@ -20,7 +20,7 @@
</p>
<p>
- foounit is a <a href="http://dojofoundation.org/">Dojo Foundation</a> project and is licensed under the Dojo Foundation License. This basically <a href="http://dojofoundation.org/about/hundredpoint">means</a> that no One Company owns the project and the code is gauranteed to be IP Free (free as in beer). This is another reason <a href="#/faq/jasmine">why I didn't want to use Jasmine</a>.
+ foounit is licensed under the <a href="http://dojotoolkit.org/license">Dojo License</a>. This basically <a href="http://dojofoundation.org/about/hundredpoint">means</a> that no One Company owns the project and the code is gauranteed to be IP Free (free as in beer).
</p>
<p>
View
2  site/www/src/documents/download.html
@@ -5,7 +5,7 @@
<h1>Download</h1>
<p>
- Get the browser version: <a href="downloads/foounit-$version-browser.tar.gz">foounit-$version-src.tar.gz</a>
+ Get the browser version: <a href="downloads/foounit-$version-browser.tar.gz">foounit-$version-src.tar.gz</a><br>
Get the node version:
<pre class="code">
$ npm install -g foounit
View
48 spec/helpers/server_helpers.js
@@ -1,48 +0,0 @@
-var http = require('http')
- , url = require('url');
-
-var Inbox = function (){
- var _queue = [];
-
- this.takeNext = function (){
- return _queue.shift();
- };
-
- this.add = function (obj){
- _queue.push(obj);
- };
-};
-
-var TestClient = function (host, port){
- var self = this;
-
- this.host = host;
- this.port = port;
- this.inbox = new Inbox();
-
- this.get = function (path){
- var client = http.createClient(this.port, this.host)
- , request = client.request('GET', path);
-
- request.on('response', function (response){
- var body = '';
-
- response.on('data', function (chunk){
- body += chunk;
- });
-
- response.on('end', function (){
- response.body = body;
- self.inbox.add(response);
- });
- });
-
- request.end();
- }
-
- this.kill = function (){
- // TODO: If we don't kill the clients then it will hang the test suite
- };
-};
-
-module.exports.TestClient = TestClient;
View
42 spec/server/server_spec.js
@@ -1,42 +0,0 @@
-var TestServer = foounit.require(':test/server/test_server')
- , TestClient = foounit.require(':test/helpers/server_helpers').TestClient;
-
-foounit.add(function (kw){ with(kw){
- describe('foounit.server.loader', function (){
- var server, client;
-
- before(function (){
- server = TestServer.start('0.0.0.0', 5999);
- client = new TestClient('0.0.0.0.', 5999);
-
- client.get('/status');
-
- waitFor(function (){
- var response = client.inbox.takeNext();
- expect(response.body).to(match, /^foounit status: \d+$/);
- });
-
- // TODO: This would be cool.
- //run(function (){
- // client.get('/status');
- //});
-
- // ensure would rerun the "run" block previous after it timed-out
- // it would continue to rerun the "run" block until it timed-out N times
- //ensure(function (){
- // response = client.inbox.takeNext();
- // expect(response.body).to(include, 'status:');
- //});
- });
-
- after(function (){
- server.stop();
- client.kill();
- });
-
- xit('passes', function (){
- //console.log('w00t!');
- });
- });
-
-}});
View
25 spec/server/test_server.js
@@ -1,25 +0,0 @@
-var connect = require('connect')
- , pth = require('path')
- , services = foounit.require(':src/foounit-server');
-
-var server;
-
-exports.start = function (host, port){
- server = connect(
- services.loader('/foounit', foounit.getMounts())
- , services.status('/status')
- );
- server.listen(port, host);
-
- return this;
-};
-
-exports.stop = function (){
- try {
- server.close();
- } catch (e){
- console.log('Error stopping server: ', e.message);
- }
-};
-
-
View
16 src/server.js
@@ -1,16 +0,0 @@
-module.exports.loader = function (root, mounts, options){
- return function (req, res, next){
- next();
- var contents = req.path;
- res.end();
- };
-};
-
-module.exports.status = function (root, options){
- options = options || {};
- options.root = root;
-
- return function (req, res, next){
- res.end('foounit status: ' + new Date().getTime());
- };
-};
Please sign in to comment.
Something went wrong with that request. Please try again.