Permalink
Browse files

Merge pull request #2 from zillow/recover-doc-error

Recover from aberrant doc generation gracefully.
  • Loading branch information...
rgrove committed Mar 15, 2012
2 parents f31e18c + de48550 commit c86897481303607a80b733a9a2115b0c19ea7424
Showing with 19 additions and 1 deletion.
  1. +19 −1 build.js
View
@@ -116,7 +116,25 @@ function onFetchSuccess(data) {
if (klass.methods) {
util.each(klass.methods, function (method, name) {
- var match = name.match(/\.([^\.]+)$/);
+ var match, descr;
+
+ // catch a doc bug where description gets inserted in method name
+ if (name && name.indexOf('\n') > -1) {
+ descr = name.split('\n');
+ // clean method name
+ name = descr.shift().trim();
+ // append to existing description, if present
+ if (method.description) {
+ descr.unshift(method.description);
+ }
+ // augment methods object with clean copy of method config
+ klass.methods[name] = util.merge(method, {
+ description: descr.join('\n'),
+ name: name
+ });
+ }
+
+ match = name.match(/\.([^\.]+)$/);
name = match ? match[1].trim() : name.trim();

0 comments on commit c868974

Please sign in to comment.