Comparing version 1.2.12 to 1.2.13
{ | ||
"name": "rbwhat", | ||
"version": "1.2.12", | ||
"version": "1.2.13", | ||
"description": "Quickly list review-board requests that need your attention", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
#!/usr/bin/env node | ||
// Generated by CoffeeScript 1.8.0 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
var allowedAge, byAge, client, colorName, config, configPath, deprecateKey, extend, formatBug, formatDate, formatGit, formatHeading, formatUrl, fs, loadExistingConfig, loadOptions, main, moment, needsReview, outputReviewActivity, pad, printActiveRequest, querystringify, rbapi, rbapiDiffs, rbapiReviewRequests, rbapiReviews, syncConfig, tooOld, user, | ||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | ||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | ||
@@ -33,2 +33,3 @@ require('colors'); | ||
ignore_repos: [], | ||
maxHistory: 4, | ||
filter: { | ||
@@ -63,10 +64,10 @@ status: 'pending', | ||
outputReviewActivity = function(submitter, request, reviews) { | ||
var date, output, review, reviewer, show, _i, _len, _ref, _ref1; | ||
if (_ref = (_ref1 = request.links.repository) != null ? _ref1.title : void 0, __indexOf.call(config.ignore_repos, _ref) >= 0) { | ||
var date, firstOutput, i, len, output, ref, ref1, review, reviewer, show; | ||
if (ref = (ref1 = request.links.repository) != null ? ref1.title : void 0, indexOf.call(config.ignore_repos, ref) >= 0) { | ||
return; | ||
} | ||
output = formatHeading(submitter, request); | ||
output = []; | ||
show = user !== submitter; | ||
for (_i = 0, _len = reviews.length; _i < _len; _i++) { | ||
review = reviews[_i]; | ||
for (i = 0, len = reviews.length; i < len; i++) { | ||
review = reviews[i]; | ||
date = review.timestamp; | ||
@@ -77,2 +78,7 @@ reviewer = review.links.user.title; | ||
} | ||
if (output.length > config.maxHistory) { | ||
firstOutput = [output[0]]; | ||
output = firstOutput.concat(output.slice(-(config.maxHistory - 1))); | ||
} | ||
output = formatHeading(submitter, request).concat(output); | ||
if (show) { | ||
@@ -98,3 +104,3 @@ return console.log(output.join('\n') + '\n'); | ||
formatHeading = function(submitter, request) { | ||
var bug, heading, _ref; | ||
var bug, heading, ref; | ||
heading = [request.summary.bold]; | ||
@@ -105,3 +111,3 @@ bug = request.bugs_closed[0]; | ||
} | ||
heading.push(formatGit(request.branch, (_ref = request.links.repository) != null ? _ref.title : void 0)); | ||
heading.push(formatGit(request.branch, (ref = request.links.repository) != null ? ref.title : void 0)); | ||
return heading.concat(formatUrl(request.id)); | ||
@@ -129,3 +135,3 @@ }; | ||
diff = config.linkDiff ? 'diff' : ''; | ||
return ' ' + ("" + config.url + "r/" + request_id + "/" + diff).underline; | ||
return ' ' + (config.url + "r/" + request_id + "/" + diff).underline; | ||
}; | ||
@@ -132,0 +138,0 @@ |
@@ -62,2 +62,3 @@ # Description | ||
* View all possible [jira api filters here](http://www.reviewboard.org/docs/manual/dev/webapi/2.0/resources/review-request-list/). | ||
* maxHistory limits the lines of history to show for each review, default of 4, which will show the first line and the last 3 lines. | ||
* See ~/.rbwhat.json for all config options. | ||
@@ -64,0 +65,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57688
210
75