diff --git a/.gitignore b/.gitignore index fb7b73015..fc99d1227 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +docs/* .tmp* cookbook* site/docs/* diff --git a/.gitmodules b/.gitmodules index e24b5d3fb..de5d08310 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,6 @@ [submodule "can"] path = can url = git://github.com/bitovi/canjs.git -[submodule "canui"] - path = canui - url = git://github.com/bitovi/canui.git -[submodule "jquery"] - path = jquery - url = git://github.com/bitovi/jquerypp.git [submodule "steal"] path = steal url = git://github.com/bitovi/steal.git @@ -16,3 +10,9 @@ [submodule "documentjs"] path = documentjs url = git://github.com/bitovi/documentjs.git +[submodule "jquerypp"] + path = jquerypp + url = https://github.com/bitovi/jquerypp.git +[submodule "jmvc"] + path = jmvc + url = git://github.com/bitovi/jmvc-generators diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 000000000..54ec9d1dd --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,18 @@ +module.exports = function (grunt) { + + grunt.loadNpmTasks('grunt-contrib-connect'); + + grunt.initConfig({ + connect: { + server: { + options: { + port: 8000, + base: '.', + keepalive: true + } + } + } + }) + + grunt.registerTask("server", "connect:server") +}; \ No newline at end of file diff --git a/build/changelog.ejs b/build/changelog.ejs new file mode 100644 index 000000000..4205c23e0 --- /dev/null +++ b/build/changelog.ejs @@ -0,0 +1,4 @@ +__<%= version %>__ ( <%= date.toDateString().substring(4) %> ) +<% for(var i = 0; i < issues.length; i++) { %> +- change: [<%= issues[i].title %>](<%= issues[i].url %>)<% } %> + diff --git a/build/tasks/bannerize.js b/build/tasks/bannerize.js index d97720469..2eb1540df 100644 --- a/build/tasks/bannerize.js +++ b/build/tasks/bannerize.js @@ -1,23 +1,16 @@ var path = require('path'); -// A grunt task that strips multiline comments +// A grunt task that writes the banner to every file module.exports = function (grunt) { grunt.registerMultiTask('bannerize', 'Adds the banner to a set of files', function () { - var _ = grunt.utils._; var options = grunt.config.process(['bannerize', this.target]); - var banner = grunt.helper('banner'); - var defaults = _.extend({ exclude : [] }, grunt.config('strip')._options); - grunt.file.expandFiles(this.file.src).forEach(function (file) { - for(var i = 0; i < defaults.exclude.length; i++) { - if(defaults.exclude[i].test(file)) { - return; - } - } + var banner = this.data.banner; + + grunt.file.expand(this.data.files).forEach(function (file) { var outFile = options.out ? path.join(options.out, path.basename(file)) : file; - grunt.log.writeln('Adding banner to ' + file); - var code = grunt.helper('file_strip_banner', file, { block : true }); - grunt.file.write(outFile, banner + code); + grunt.log.writeln('Adding banner to ' + file); + grunt.file.write(outFile, banner + grunt.file.read(file)); }); }); } diff --git a/build/tasks/beautify.js b/build/tasks/beautify.js index de999530e..df48cf113 100644 --- a/build/tasks/beautify.js +++ b/build/tasks/beautify.js @@ -5,6 +5,7 @@ * Copyright (c) 2012 Camille Moncelier * Licensed under the MIT license. */ +var beautifier = require('js-beautify'); module.exports = function (grunt) { @@ -18,8 +19,6 @@ module.exports = function (grunt) { }; grunt.registerMultiTask('beautify', 'Javascript beautifier', function () { - var beautifier = require('node-beautify'); - var options = null; var tmp = grunt.config(['beautifier', this.target, 'options']); if (typeof tmp === 'object') { @@ -38,7 +37,13 @@ module.exports = function (grunt) { // Beautify specified files. var excludes = grunt.config(['beautifier', this.target, 'exclude']); - grunt.file.expandFiles(this.file.src).filter(function (file) { + + grunt.file.expand(this.filesSrc).filter(function (file) { + if(/\.min\./.test(file)) { + grunt.log.writeln('Not beautifying ' + file); + return false; + } + for (var i = 0; i < excludes.length; i++) { if (excludes[i].test(file)) { grunt.log.writeln('Not beautifying ' + file); @@ -48,7 +53,7 @@ module.exports = function (grunt) { return true; }).forEach(function (filepath) { grunt.log.writeln('Beautifying ' + filepath); - var result = beautifier.beautifyJs(grunt.file.read(filepath), options); + var result = beautifier(grunt.file.read(filepath), options); grunt.file.write(filepath, result); }); diff --git a/build/tasks/build.js b/build/tasks/build.js index 63537e8f3..69c13dbf7 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -5,35 +5,27 @@ module.exports = function( grunt ) { grunt.registerMultiTask('build', 'Runs build files.', function() { var done = this.async(); var target = this.target; - var files = Array.isArray(this.file.src) ? this.file.src : [this.file.src]; - // TODO grunt.file.expandFiles(this.file.src); - var series = files.map(function (file) { - return function(callback) { - var options = grunt.config.process(['build', target]); - var args = [file, options.out || 'dist/', options.version || 'edge']; - var libraries = Array.isArray(options.libraries) ? options.libraries : []; - args.push.apply(args, libraries); + var options = grunt.config.process(['build', target]); + var args = [this.data.src, this.data.out || 'dist/', this.data.version || 'edge']; + var libraries = Array.isArray(this.data.libraries) ? this.data.libraries : []; - grunt.verbose.writeflags(options, 'Options'); - grunt.log.writeln('Running ./js ' + args.join(' ')); + args.push.apply(args, libraries); - grunt.utils.exec({ - cmd : "./js", - args : args, - opts : { - cwd: jsDir - } - }, function(error, result, code) { - callback(error, result, code); - }); + grunt.verbose.writeflags(this.data, 'Options'); + grunt.log.writeln('Running ./js ' + args.join(' ')); - grunt.log.write("Building " + file + " with Steal...\n"); + grunt.util.spawn({ + cmd : "./js", + args : args, + opts : { + cwd: jsDir } - }); - grunt.utils.async.parallel(series, function(error, results) { + }, function(error, result, code) { grunt.log.writeln('Done building'); done(); - }) + }); + + grunt.log.write("Building " + this.data.src + " with Steal...\n"); }); }; diff --git a/build/tasks/changelog.js b/build/tasks/changelog.js new file mode 100644 index 000000000..6215b6f25 --- /dev/null +++ b/build/tasks/changelog.js @@ -0,0 +1,65 @@ +var https = require('https'), +querystring = require('querystring'), +ejs = require('ejs'); + +module.exports = function(grunt) { + + grunt.registerMultiTask('changelog', 'Updates changelog.md based on GitHub milestones', function() { + var done = this.async(), + + params = querystring.stringify({ + milestone: this.data.milestone, + state: 'closed', + per_page: 100 + }), + + path = '/repos/' + this.data.user + '/' + this.data.repo + '/issues?' + params, + + buffer = '', + self = this; + + var write = function() { + var issues = JSON.parse(buffer), + log = ''; + + if(grunt.file.exists('changelog.md')) { + log = grunt.file.read('changelog.md'); + }; + + ejs.renderFile(__dirname + '/../changelog.ejs', { + version: self.data.version, + date: new Date(Date.now()), + issues: issues + }, function(e, template) { + + if(e) { + done(e); + } + + grunt.file.write('changelog.md', template + log); + done(); + + }); + }, + + req = https.request({ + hostname: 'api.github.com', + path: path + }, function(res) { + + res.on('data', function(data) { + buffer += data; + }); + + res.on('end', write); + }); + + req.end(); + + req.on('error', function(e) { + done(e); + }); + + }); + +} \ No newline at end of file diff --git a/build/tasks/docco.js b/build/tasks/docco.js index 8b80d8d11..964a668c3 100644 --- a/build/tasks/docco.js +++ b/build/tasks/docco.js @@ -5,24 +5,18 @@ var docco = require('docco'); module.exports = function(grunt) { grunt.registerMultiTask('docco', 'Docco processor.', function() { - var _ = grunt.utils._; - var options = grunt.config.process(['docco', this.target]); - var defaults = _.extend({ - exclude : [/\.min\./] - }, grunt.config.process('docco')._options); - grunt.verbose.writeflags(options, 'Options'); + var _ = grunt.util._; var done = this.async(); - var src = grunt.file.expandFiles(this.file.src).filter(function(file) { - for(var i = 0; i < defaults.exclude.length; i++) { - if(defaults.exclude[i].test(file)) { - return false; - } - } - return true; + var options = this.options(); + var src = grunt.file.expand(this.data.files).filter(function(file) { + return !_.some(options.exclude, function(exclude) { + return exclude.test(file); + }); }); - docco.document(src, _.extend({}, defaults.docco, options.docco) || {}, function(err, result, code){ - grunt.log.writeln("Doccoed [" + src.join(", ") + "]; " + err ? err : "(No errors)" + "\n" + result + " " + code); + docco.document( _.extend({ args: src }, this.data.docco, options.docco), function(err, result, code){ + grunt.log.writeln("Doccoed [" + src.join(", ") + "]; " + + err ? err : "(No errors)" + "\n" + result + " " + code); done(); }); }); diff --git a/build/tasks/downloads.js b/build/tasks/downloads.js deleted file mode 100644 index e2c29abe4..000000000 --- a/build/tasks/downloads.js +++ /dev/null @@ -1,103 +0,0 @@ -var program = require("commander"); -var GitHubApi = require("github"); -var authenticated = false; -var fs = require('fs'); -var github = new GitHubApi({ - version : "3.0.0" -}); -var getCredentials = function (callback) { - if(authenticated) { - return callback(); - } - - program.prompt("Github Username: ", function (name) { - var username = name; - - program.password("Github Password: ", "*", function (pass) { - var password = pass; - process.stdin.pause(); - github.authenticate({ - type : "basic", - username : username, - password : password - }); - authenticated = true; - callback(); - }); - - }); -} - -module.exports = function (grunt) { - grunt.registerMultiTask('downloads', 'Uploads generated files as GitHub downloads.', function () { - if(this.target == '_options') { - return; - } - - var _ = grunt.utils._; - var done = this.async(); - var ops = grunt.config(['downloads', this.target]); - var defaults = _.extend({}, grunt.config(['downloads', '_options'])); - var sourceFile = this.file.src; - - var desc = grunt.template.process(ops.description); - var name = grunt.template.process(ops.filename); - - grunt.log.writeln('Deploying ' + desc); - fs.readFile(sourceFile, function (err, buf) { - if (err) { - return grunt.fail.fatal(err); - } - - var createDownload = function() { - github.httpSend({ - "user" : defaults.user, - "repo" : defaults.repository, - "name" : name, - "size" : buf.length, - "description" : desc, - "content_type" : ops.content_type || "text/javascript" - }, { - "url" : "/repos/:user/:repo/downloads", - "method" : "POST", - "params" : { - "$user" : null, - "$repo" : null, - "$name" : null, - "$size" : null, - "description" : null, - "$content_type" : null - } - }, function (err, socket) { - if(err) { - return grunt.fail.fatal(err); - } - var data = JSON.parse(socket.data); - - grunt.utils.s3.postToS3({ - key : data.path, - acl : data.acl, - success_action_status : "201", - Filename : data.name, - AWSAccessKeyId : data.accesskeyid, - policy64 : data.policy, - signature64 : data.signature, - contentType : data.mime_type, - data : buf, - bucket : "github" - }, function (e) { - if(e) { - return grunt.fail.fatal(e); - } - grunt.log.writeln('Successfully created GitHub download and uploaded to S3.'); - done(); - }) - }); - } - - grunt.log.writeln('Uploading to ' + defaults.user + '/' + defaults.repository + '/' + name); - getCredentials(createDownload); - - }); - }); -} \ No newline at end of file diff --git a/build/tasks/shell.js b/build/tasks/shell.js deleted file mode 100644 index 89d28831a..000000000 --- a/build/tasks/shell.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * grunt-shell - * 0.1.2 - 2012-06-28 - * github.com/sindresorhus/grunt-shell - * - * (c) Sindre Sorhus - * sindresorhus.com - * MIT License - */ -module.exports = function (grunt) { - 'use strict'; - - var _ = grunt.utils._; - var log = grunt.log; - - grunt.registerMultiTask('shell', 'Run shell commands', function () { - var exec = require('child_process').exec; - var done = this.async(); - var data = _.extend([], grunt.config.get('shell')._options, this.data); - var dataOut = data.stdout; - var dataErr = data.stderr; - - if (_.isFunction(data.callback)) { - data.callback.call(this); - return; - } - - var command = grunt.template.process(this.file.src); - log.writeln('Running ' + command); - exec(command, data.execOptions, function (err, stdout, stderr) { - if (stdout) { - if (_.isFunction(dataOut)) { - dataOut(stdout); - } else if (dataOut === true) { - log.write(stdout); - } - } - - if (err) { - if (_.isFunction(dataErr)) { - dataErr(stderr); - } else if (data.failOnError === true) { - grunt.fatal(err); - } else if (dataErr === true) { - log.error(err); - } - } - - done(); - }); - }); -}; \ No newline at end of file diff --git a/build/tasks/strip.js b/build/tasks/strip.js deleted file mode 100644 index 31558b192..000000000 --- a/build/tasks/strip.js +++ /dev/null @@ -1,36 +0,0 @@ -var path = require('path'); - -// A grunt task that strips multiline comments -module.exports = function (grunt) { - grunt.registerMultiTask('strip', 'Remove multiline comments from files', function () { - var _ = grunt.utils._; - var options = grunt.config.process(['strip', this.target]); - var defaults = _.extend({ - exclude : [/\.min\./] - }, grunt.config('strip')._options); - grunt.file.expandFiles(this.file.src).forEach(function (file) { - for(var i = 0; i < defaults.exclude.length; i++) { - if(defaults.exclude[i].test(file)) { - return; - } - } - var outFile = options.out ? path.join(options.out, path.basename(file)) : file; - grunt.log.writeln('Stripping ' + file + ' of all multiline and empty inline comments'); - - var code = grunt.file.read(file); - - // Remove multiline comments - code = code.replace(/\/\*([\s\S]*?)\*\//gim, "") - .replace(/\/\/(\s*)\n/gim, ""); - - // Remove double semicolons from steal pluginify - code = code.replace(/;[\s]*;/gim, ";"); - code = code.replace(/(\/\/.*)\n[\s]*;/gi, "$1"); - - // Only single new lines - code = code.replace(/(\n){3,}/gim, "\n\n"); - - grunt.file.write(outFile, code); - }); - }); -} diff --git a/build/tasks/testify.js b/build/tasks/testify.js new file mode 100644 index 000000000..6aa1190e1 --- /dev/null +++ b/build/tasks/testify.js @@ -0,0 +1,54 @@ +var ejs = require('ejs'); +var beautify = require('js-beautify'); + +module.exports = function(grunt) { + var _ = grunt.util._; + + grunt.registerMultiTask('testify', 'Generates test runners', function() { + var done = this.async(); + var data = this.data; + var template = grunt.file.read(this.data.template); + var transform = this.data.transform || {}; + var modules = this.data.builder.modules; + var configurations = this.data.builder.configurations; + + _.each(configurations, function(config, configurationName) { + var options = { + configuration: config, + modules: [], + tests: [], + root: data.root, + '_': _ + }; + + _.each(modules, function(definition, key) { + if(!definition.configurations || definition.configurations.indexOf(configurationName) !== -1) { + var name = key.substr(key.lastIndexOf('/') + 1); + var mod = transform.module ? transform.module(definition, key) : key; + var test = transform.test ? transform.test(definition, key) : (key + '/' + name + '_test.js'); + + mod && options.modules.push(mod); + test && options.tests.push(test); + } + }); + + _.extend(config.steal, { + root: data.root + }); + + if(transform && transform.options) { + _.extend(options, transform.options.call(config, configurationName)); + } + + var lib = '\n'+ + beautify.html(ejs.render(template, options), { + "wrap_line_length": 70 + }); + + grunt.log.writeln('Generating ' + data.out + configurationName + '.html'); + grunt.file.write(data.out + configurationName + '.html', lib); + }); + + done(); + }); +}; \ No newline at end of file diff --git a/build/tasks/updateversion.js b/build/tasks/updateversion.js new file mode 100644 index 000000000..5febe4698 --- /dev/null +++ b/build/tasks/updateversion.js @@ -0,0 +1,20 @@ +var path = require('path'); + +// A grunt task that writes the banner to every file +module.exports = function (grunt) { + grunt.registerMultiTask('updateversion', 'Replaces given symbol with current version', function () { + var options = grunt.config.process(['updateversion', this.target]); + var version = this.data.version; + var symbol = this.data.symbol; + + grunt.file.expand(this.data.files).forEach(function (file) { + var outFile = options.out ? path.join(options.out, path.basename(file)) : file; + var fileContents = grunt.file.read(file).replace(symbol, version); + + if(grunt.file.read(file).match(symbol)) { + grunt.log.writeln('Updating version in ' + file); + grunt.file.write(outFile, fileContents.replace(symbol, version)); + } + }); + }); +} diff --git a/build/tasks/utils.js b/build/tasks/utils.js deleted file mode 100644 index 4f014fd54..000000000 --- a/build/tasks/utils.js +++ /dev/null @@ -1,137 +0,0 @@ -var spawn = require("child_process").spawn; - -// { -// // The command to execute. It should be in the system path. -// cmd: commandToExecute, -// // An array of arguments to pass to the command. -// args: arrayOfArguments, -// // Additional options for the Node.js child_process spawn method. -// opts: nodeSpawnOptions -// } - -module.exports = function (grunt) { - grunt.utils.exec = function (options, callback) { - var build = grunt.utils.spawn(options, callback); - - build.stdout.on("data", function (buf) { - grunt.log.write("" + buf); - }); - - build.stderr.on("data", function (buf) { - grunt.log.write("" + buf); - }); - - build.on("exit", function (code) { - callback(null, code); - }); - - return build; - }; - - // Generated by CoffeeScript 1.3.1 - (function () { - var crypto, https, joinBuffers, postToS3, readText, signPolicy, url, _ref; - - url = require('url'); - - https = require('https'); - - crypto = require('crypto'); - - _ref = require('tafa-misc-util'), joinBuffers = _ref.joinBuffers, readText = _ref.readText; - - signPolicy = function (secretKey, policy) { - var data, hmac, json, key, policy64, signature64; - json = JSON.stringify(policy); - policy64 = new Buffer(json).toString('base64'); - data = new Buffer(policy64, 'utf-8'); - key = new Buffer(secretKey, 'utf-8'); - hmac = crypto.createHmac('sha1', key); - hmac.update(data); - signature64 = hmac.digest('base64'); - return { - signature64 : signature64, - policy64 : policy64 - }; - }; - - postToS3 = function (_arg, callback) { - var AWSAccessKeyId, Filename, acl, addParam, arr, boundary, bucket, buf, ca, contentType, customUrl, data, host, hostname, key, options, policy64, port, protocol, req, req_body, signature64, success_action_status, _ref1; - AWSAccessKeyId = _arg.AWSAccessKeyId, policy64 = _arg.policy64, signature64 = _arg.signature64, bucket = _arg.bucket, key = _arg.key, data = _arg.data, boundary = _arg.boundary, customUrl = _arg.customUrl, ca = _arg.ca, acl = _arg.acl, success_action_status = _arg.success_action_status, Filename = _arg.Filename, contentType = _arg.contentType; - if (callback == null) { - callback = (function () { - }); - } - if (customUrl) { - _ref1 = url.parse(customUrl), protocol = _ref1.protocol, hostname = _ref1.hostname, port = _ref1.port; - if (protocol !== "https:") { - return callback(new Error("customUrl must be https://")); - } - host = hostname; - port || (port = 443); - } else { - host = "" + bucket + ".s3.amazonaws.com"; - port = 443; - } - boundary || (boundary = '----------R46EARkAg4SAXSjufGsb6m'); - buf = function (x) { - return new Buffer(x); - }; - arr = []; - addParam = function (k, v) { - arr.push(buf('--' + boundary + '\r\n')); - arr.push(buf('Content-Disposition: form-data; name="' + k + '"\r\n\r\n')); - return arr.push(buf(v), buf('\r\n')); - }; - addParam('key', key); - addParam('acl', acl); - addParam('success_action_status', success_action_status); - addParam('Filename', Filename); - addParam('AWSAccessKeyId', AWSAccessKeyId); - addParam('Policy', policy64); - addParam('Signature', signature64); - addParam('Content-Type', contentType); - arr.push(buf('--' + boundary + '\r\n')); - arr.push(buf('Content-Disposition: form-data; name="file"; filename="data"\r\n')); - arr.push(buf("Content-Length: " + data.length + "\r\n")); - arr.push(buf('Content-Transfer-Encoding: binary\r\n\r\n')); - arr.push(data, buf('\r\n')); - arr.push(buf('--' + boundary + '--')); - req_body = joinBuffers(arr); - options = { - host : host, - port : port, - path : '/', - method : 'POST', - headers : { - 'Host' : "" + bucket + ".s3.amazonaws.com", - 'Content-Type' : 'multipart/form-data; boundary=' + boundary, - 'Content-Length' : req_body.length - } - }; - if (ca) { - options.ca = ca; - } - req = https.request(options, function (res) { - var _ref2; - if ((200 <= (_ref2 = res.statusCode) && _ref2 < 300)) { - return callback(null); - } else { - return readText(res, function (text) { - return callback({ - responseCode : res.statusCode, - responseText : text - }); - }); - } - }); - return req.end(req_body); - }; - - grunt.utils.s3 = { - postToS3 : postToS3, - signPolicy : signPolicy - }; - - }).call(this); -} \ No newline at end of file diff --git a/can b/can index f16f5f0b6..1a46211f4 160000 --- a/can +++ b/can @@ -1 +1 @@ -Subproject commit f16f5f0b6d53107340cceb1f3f044c409533e225 +Subproject commit 1a46211f419ad39e10be11220ce723be1485112a diff --git a/canui b/canui deleted file mode 160000 index 538977ddc..000000000 --- a/canui +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 538977ddc99e5d2ac2c87286c05da1c87451ead5 diff --git a/documentjs b/documentjs index 3d9ca968e..99e1215df 160000 --- a/documentjs +++ b/documentjs @@ -1 +1 @@ -Subproject commit 3d9ca968edb5d1d779686ca0323f9b9a54e56cf5 +Subproject commit 99e1215df6cab9ebc3adf3d8801fd6339bf1bdc2 diff --git a/funcunit b/funcunit index 9da5a5617..1b0194d98 160000 --- a/funcunit +++ b/funcunit @@ -1 +1 @@ -Subproject commit 9da5a561758202083163e6a7747ac9ce07d3e412 +Subproject commit 1b0194d984f93be68c8d5dc8aba05196f1844ec2 diff --git a/grunt.js b/grunt.js deleted file mode 100644 index 9d5cb6995..000000000 --- a/grunt.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (grunt) { - -}; \ No newline at end of file diff --git a/jmvc b/jmvc new file mode 160000 index 000000000..fffedf3c9 --- /dev/null +++ b/jmvc @@ -0,0 +1 @@ +Subproject commit fffedf3c9503cc89154156bf7aac37f415e20edd diff --git a/jmvc/generate/app b/jmvc/generate/app deleted file mode 100644 index 0f6238f24..000000000 --- a/jmvc/generate/app +++ /dev/null @@ -1,22 +0,0 @@ -// _args = ['cookbook']; load('steal/generate/app') - -if (!_args[0]) { - print("Usage: steal/js steal/generate/app path"); - quit(); -} - -load('steal/rhino/rhino.js'); - -steal('steal/generate','steal/generate/system.js', function(steal) { - var moduleId = _args[0]; - var md = steal.generate.convert(moduleId), - data = steal.extend({ - path: moduleId, - application_name: md._alias, - current_path: steal.File.cwdURL(), - path_to_steal : steal.File(moduleId).pathToRoot() - }, steal.system); - - steal.generate("jmvc/generate/templates/app", moduleId, data); -}); - diff --git a/jmvc/generate/coffee/controller b/jmvc/generate/coffee/controller deleted file mode 100644 index a547f8a21..000000000 --- a/jmvc/generate/coffee/controller +++ /dev/null @@ -1,35 +0,0 @@ -if (_args.length < 1) { - print("USAGE : steal/js steal/generate/coffee/controller Company.Widget") - print("EX : steal/js steal/generate/coffee/controller Company.WidgetName"); - print(" > company/widget_name/widget_name.coffee") - print(); - quit(); -} - -load('steal/rhino/rhino.js'); - -steal( '//steal/generate/generate', - '//steal/generate/system', -function(steal){ - var upper = function(parts){ - for(var i =0; i < parts.length; i++){ - parts[i] = parts[i].charAt(0).toUpperCase()+parts[i].substr(1) - } - return parts - } - - if(_args[0].charAt(0) !== _args[0].charAt(0).toUpperCase()){ - var caps = upper( _args[0].split(/_|-/) ).join(''), - name = upper(caps.split("/")).join('.'); - - print(" Creating "+name); - _args[0] = name; - } - - var md = steal.generate.convert(_args[0]), - path = _args[0].toLowerCase().replace('.',"/"); - md.path_to_steal = new steal.File(path).pathToRoot() - steal.generate("jquery/generate/coffee/templates/controller",md.path+"/"+md.underscore,md) - -}); - diff --git a/jmvc/generate/coffee/templates/controller/(underscore).coffee.ejs b/jmvc/generate/coffee/templates/controller/(underscore).coffee.ejs deleted file mode 100644 index 61c267b76..000000000 --- a/jmvc/generate/coffee/templates/controller/(underscore).coffee.ejs +++ /dev/null @@ -1,11 +0,0 @@ -steal "jquery/controller", -($) -> - - $.Controller "<%= name %>", - { - defaults : {}, - }, - { - init : -> - @element.html "Hello World!" - } diff --git a/jmvc/generate/coffee/templates/controller/(underscore).html.ejs b/jmvc/generate/coffee/templates/controller/(underscore).html.ejs deleted file mode 100644 index 7ad7f07cc..000000000 --- a/jmvc/generate/coffee/templates/controller/(underscore).html.ejs +++ /dev/null @@ -1,24 +0,0 @@ - - -
-