Skip to content

Commit 99c80c2

Browse files
author
Eric Mrak
committed
Update to version 4.0.0
1 parent 1cc1b91 commit 99c80c2

File tree

9 files changed

+33
-26
lines changed

9 files changed

+33
-26
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
# Changelog
22

3-
## unreleased
3+
## 4.0.0
44

5-
* Adds `hits` to the endpoint data that is returned from the admin portal that represents the amount of times that endpoint has been hit from the stubs portal.
5+
This project has been stable for some time, best we move to actual semver and
6+
not prerelease versioning. This release on the old versioning system would have been release `0.4.0`. It is now `4.0.0` instead.
7+
8+
* __BREAKING CHANGES from 0.3.x__
9+
* The `mute` option has been renamed `quiet` to be more consistent with other cli tools
10+
11+
* __New features__
12+
* Adds `hits` to the endpoint data that is returned from the admin portal that represents the amount of times that endpoint has been hit from the stubs portal.
613

714
## 0.3.1
815

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Some systems require you to `sudo` before running services on port certain ports
5858
## Command-line Switches
5959

6060
```
61-
stubby [-a <port>] [-c <file>] [-d <file>] [-h] [-k <file>] [-l <hostname>] [-m] [-p <file>]
61+
stubby [-a <port>] [-c <file>] [-d <file>] [-h] [-k <file>] [-l <hostname>] [-p <file>] [-q]
6262
[-s <port>] [-t <port>] [-v] [-w]
6363
6464
-a, --admin <port> Port for admin portal. Defaults to 8889.
@@ -67,7 +67,7 @@ stubby [-a <port>] [-c <file>] [-d <file>] [-h] [-k <file>] [-l <hostname>] [-m]
6767
-h, --help This help text.
6868
-k, --key <file> Private key file. Use with --cert.
6969
-l, --location <hostname> Hostname at which to bind stubby.
70-
-m, --mute Prevent stubby from printing to the console.
70+
-q, --quiet Prevent stubby from printing to the console.
7171
-p, --pfx <file> PFX file. Ignored if used with --key/--cert
7272
-s, --stubs <port> Port for stubs portal. Defaults to 8882.
7373
-t, --tls <port> Port for https stubs portal. Defaults to 7443.
@@ -675,7 +675,7 @@ What can I do with it, you ask? Read on!
675675
* `cert`: certificate file contents (in PEM format)
676676
* `pfx`: pfx file contents (mutually exclusive with key/cert options)
677677
* `watch`: filename to monitor and load as stubby's data when changes occur
678-
* `mute`: defaults to `true`. Pass in `false` to have console output (if available)
678+
* `quiet`: defaults to `true`. Pass in `false` to have console output (if available)
679679
* `_httpsOptions`: additional options to pass to the [underlying tls
680680
server](http://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener).
681681
* `callback`: takes one parameter: the error message (if there is one), undefined otherwise

man/stubby.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ And finally, a third "admin" portal that allows viewing configured data and chan
5151

5252
\-l, \-\-location <hostname> Hostname at which to bind stubby.
5353

54-
\-m, \-\-mute Prevent stubby from printing to the console.
55-
5654
\-p, \-\-pfx <file> PFX file. Ignored if used with \-\-key/\-\-cert.
5755

56+
\-q, \-\-quiet Prevent stubby from printing to the console.
57+
5858
\-s, \-\-stubs <port> Port for stubs portal. Defaults to 8882.
5959

6060
\-t, \-\-tls <port> Port for https stubs portal. Defaults to 7443.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stubby",
33
"preferGlobal": true,
4-
"version": "0.3.1",
4+
"version": "4.0.0",
55
"author": {
66
"name": "Eric Mrak",
77
"email": "mail@ericmrak.info"

src/console/cli.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ var options = [{
4141
default: '0.0.0.0',
4242
description: 'Hostname at which to bind stubby.'
4343
}, {
44-
name: 'mute',
45-
flag: 'm',
44+
name: 'quiet',
45+
flag: 'q',
4646
description: 'Prevent stubby from printing to the console.'
4747
}, {
4848
name: 'pfx',

src/console/out.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,45 @@ var YELLOW = '\x1B[33m';
1212
var RESET = '\x1B[0m';
1313

1414
var out = {
15-
mute: false,
15+
quiet: false,
1616
log: function (msg) {
17-
if (this.mute) { return; }
17+
if (this.quiet) { return; }
1818
console.log(msg);
1919
},
2020
status: function (msg) {
21-
if (this.mute) { return; }
21+
if (this.quiet) { return; }
2222
console.log(BOLD + BLACK + msg + RESET);
2323
},
2424
dump: function (data) {
25-
if (this.mute) { return; }
25+
if (this.quiet) { return; }
2626
console.dir(data);
2727
},
2828
info: function (msg) {
29-
if (this.mute) { return; }
29+
if (this.quiet) { return; }
3030
console.info(BLUE + msg + RESET);
3131
},
3232
ok: function (msg) {
33-
if (this.mute) { return; }
33+
if (this.quiet) { return; }
3434
console.log(GREEN + msg + RESET);
3535
},
3636
error: function (msg) {
37-
if (this.mute) { return; }
37+
if (this.quiet) { return; }
3838
console.error(RED + msg + RESET);
3939
},
4040
warn: function (msg) {
41-
if (this.mute) { return; }
41+
if (this.quiet) { return; }
4242
console.warn(YELLOW + msg + RESET);
4343
},
4444
incoming: function (msg) {
45-
if (this.mute) { return; }
45+
if (this.quiet) { return; }
4646
console.log(CYAN + msg + RESET);
4747
},
4848
notice: function (msg) {
49-
if (this.mute) { return; }
49+
if (this.quiet) { return; }
5050
console.log(MAGENTA + msg + RESET);
5151
},
5252
trace: function () {
53-
if (this.mute) { return; }
53+
if (this.quiet) { return; }
5454
console.log(RED);
5555
console.trace();
5656
console.log(RESET);

src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function setupStartOptions(options, callback) {
5555
options = {};
5656
}
5757

58-
if (options.mute == null) { options.mute = true; }
58+
if (options.quiet == null) { options.quiet = true; }
5959

6060
defaults = CLI.getArgs([]);
6161
for (key in defaults) {
@@ -64,7 +64,7 @@ function setupStartOptions(options, callback) {
6464
}
6565
}
6666

67-
out.mute = options.mute;
67+
out.quiet = options.quiet;
6868
return [options, callback];
6969
}
7070

test/admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var Admin = require('../src/portals/admin').Admin;
44
var assert = require('assert');
55

6-
require('../src/console/out').mute = true;
6+
require('../src/console/out').quiet = true;
77

88
describe('Admin', function () {
99
var endpoints, request, response, sut;

test/cli.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ describe('CLI', function () {
244244
cert: 'a certificate',
245245
pfx: 'a pfx',
246246
tls: '443',
247-
mute: true,
247+
quiet: true,
248248
watch: filename,
249249
datadir: process.cwd(),
250250
help: undefined, // eslint-disable-line no-undefined
@@ -255,7 +255,7 @@ describe('CLI', function () {
255255
this.sandbox.stub(sut, 'cert').returns(expected.cert);
256256
this.sandbox.stub(sut, 'pfx').returns(expected.pfx);
257257

258-
actual = sut.getArgs(['-s', expected.stubs, '-a', expected.admin, '-d', filename, '-l', expected.location, '-k', 'mocked', '-c', 'mocked', '-p', 'mocked', '-t', expected.tls, '-m', '-w']);
258+
actual = sut.getArgs(['-s', expected.stubs, '-a', expected.admin, '-d', filename, '-l', expected.location, '-k', 'mocked', '-c', 'mocked', '-p', 'mocked', '-t', expected.tls, '-q', '-w']);
259259

260260
assert.deepStrictEqual(actual, expected);
261261
});

0 commit comments

Comments
 (0)