diff --git a/lib/docparser.js b/lib/docparser.js index 896553c3..f72f162f 100644 --- a/lib/docparser.js +++ b/lib/docparser.js @@ -422,7 +422,30 @@ YUI.add('docparser', function (Y) { }, // @throws {type} description - 'throws': 'return', + 'throws': function(tagname, value, target) { + + target[tagname] = target[tagname] || []; + + var desc = implodeString(trim(value)), + type, + match = REGEX_TYPE.exec(desc), + result = {}; + + if (match) { + type = fixType(trim(match[2])); + desc = trim(match[1] + match[3]); + } + + result = { + description: Y.unindent(explodeString(desc)) + }; + + if (type) { + result.type = type; + } + + target[tagname].push(result); + }, 'injects': 'return', diff --git a/lib/options.js b/lib/options.js index 6daacc15..6a6f0eb2 100644 --- a/lib/options.js +++ b/lib/options.js @@ -24,6 +24,7 @@ YUI.add('options', function (Y) { Y.Options = function (args) { var options = { port: 3000, + ip: '127.0.0.1', nocode: false }; @@ -108,12 +109,19 @@ YUI.add('options', function (Y) { case '--server': options.server = true; var a = args.shift(); + var delim = a.indexOf(':'); + if (delim >= 0) { + var socket = a.split(':'); + options.ip = socket[0]; + options.port = socket[1]; + break; + } var p = parseInt(a, 10); if (isNaN(p) || !p) { if (a) { args.unshift(a); } - Y.log('Failed to extract port, setting to the default :3000', 'warn', 'yuidoc'); + Y.log('Failed to extract socket, setting to the default 127.0.0.1:3000', 'warn', 'yuidoc'); } else { options.port = p; } diff --git a/lib/server.js b/lib/server.js index c8025aaf..87a03588 100644 --- a/lib/server.js +++ b/lib/server.js @@ -193,9 +193,9 @@ YUI.add('server', function (Y) { stat = Server.options.themedir || path.join(__dirname, '../', 'themes', 'default'); Server.app.use(express.static(stat)); Server.routes(); - Server.app.listen(Server.options.port); + Server.app.listen(Server.options.port, Server.options.ip); - Y.log('Starting server: http:/' + '/127.0.0.1:' + Server.options.port, 'info', 'server'); + Y.log('Starting server: http://' + Server.options.ip + ':' + Server.options.port, 'info', 'server'); }, /** * Start the server with the supplied options. diff --git a/themes/default/partials/method.handlebars b/themes/default/partials/method.handlebars index 664d79b1..92f31120 100644 --- a/themes/default/partials/method.handlebars +++ b/themes/default/partials/method.handlebars @@ -181,24 +181,25 @@ {{/return}} - {{#throws}} + {{#if throws}}