Skip to content

Commit 6593d2e

Browse files
author
Gabriel Sambarino
committed
Merge branch 'master' of github.com:Automattic/cli-table
2 parents 8d8fcd8 + e579702 commit 6593d2e

File tree

3 files changed

+32
-56
lines changed

3 files changed

+32
-56
lines changed

examples/revs.js

+3-23
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
var Table = require('../lib');
7-
var hyperlinker = require('hyperlinker');
87

98
/**
109
* Example.
@@ -25,14 +24,9 @@ console.log(table.toString());
2524

2625
/* compact */
2726
var table = new Table({
28-
head: ['Rel', 'Change', 'By', 'Link', 'When']
29-
, style: {
30-
'padding-left': 1
31-
, 'padding-right': 1
32-
, head: []
33-
, border: []
34-
}
35-
, colWidths: [6, 21, 25, 17, 17]
27+
head: ['Rel', 'Change', 'By', 'When']
28+
, colWidths: [6, 21, 25, 17]
29+
, style : {compact : true, 'padding-left' : 1}
3630
});
3731

3832
table.push(
@@ -44,20 +38,6 @@ table.push(
4438

4539
console.log(table.toString());
4640

47-
/* with hyperlinks */
48-
var table = new Table({
49-
head: ['Rel', 'Change', 'By', 'Link', 'When']
50-
, colWidths: [6, 21, 25, 17, 17]
51-
, style : {compact : true, 'padding-left' : 1}
52-
});
53-
54-
table.push(
55-
['v0.1', 'testing something cool', '[email protected]', hyperlinker('link', 'https://adobe.com'), '7 minutes ago']
56-
, ['v0.1', 'testing something cool', '[email protected]', hyperlinker('link', 'https://adobe.com'), '8 minutes ago']
57-
);
58-
59-
console.log(table.toString());
60-
6141
/* headless */
6242
var headless_table = new Table();
6343
headless_table.push(['v0.1', 'Testing something cool', '[email protected]', '7 minutes ago']);

package.json

+29-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,29 @@
1-
{"name":"cli-table","description":"Pretty unicode tables for the CLI","version":"0.3.11","author":"Guillermo Rauch <[email protected]>","contributors":["Sonny Michaud <[email protected]> (http://github.com/sonnym)"],"repository":{"type":"git","url":"https://github.com/Automattic/cli-table.git"},"keywords":["cli","colors","table"],"dependencies":{"colors":"1.0.3"},"devDependencies":{"expresso":"~0.9","should":"~0.6"},"main":"lib","files":["lib"],"scripts":{"test":"make test"},"engines":{"node":">= 0.2.0"}}
1+
{
2+
"name": "cli-table",
3+
"description": "Pretty unicode tables for the CLI",
4+
"version": "0.3.11-dev",
5+
"author": "Guillermo Rauch <[email protected]>",
6+
"contributors": ["Sonny Michaud <[email protected]> (http://github.com/sonnym)"],
7+
"license": "MIT",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/Automattic/cli-table.git"
11+
},
12+
"keywords": ["cli", "colors", "table"],
13+
"dependencies": {
14+
"colors": "1.0.3"
15+
},
16+
"devDependencies": {
17+
"expresso": "~0.9",
18+
"should": "~0.6"
19+
},
20+
"main": "lib",
21+
"files": ["lib"],
22+
"scripts": {
23+
"test": "make test"
24+
},
25+
"engines": {
26+
"node": ">= 0.2.0"
27+
}
28+
}
29+

test/index.test.js

-32
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
require('should');
7-
var hyperlinker = require('hyperlinker');
87

98
var Table = require('../');
109

@@ -44,37 +43,6 @@ module.exports = {
4443
table.toString().should.eql(expected.join("\n"));
4544
},
4645

47-
'test table with ANSI hyperlink escape codes': function (){
48-
var table = new Table({
49-
head: ['Rel', 'Change', 'By', 'Link', 'When']
50-
, colWidths: [6, 21, 25, 17, 17]
51-
, style : {compact : true, 'padding-left' : 1, head: [], border: []}
52-
});
53-
54-
table.push(
55-
['v0.1', 'Testing something cool', '[email protected]', hyperlinker('link', 'https://adobe.com'), '7 minutes ago']
56-
, ['v0.1', 'Testing something cool', '[email protected]', hyperlinker('link', 'https://adobe.com'), '8 minutes ago']
57-
);
58-
59-
var expected = [
60-
'┌──────┬─────────────────────┬─────────────────────────┬─────────────────┬─────────────────┐'
61-
, '│ Rel │ Change │ By │ Link │ When │'
62-
, '├──────┼─────────────────────┼─────────────────────────┼─────────────────┼─────────────────┤'
63-
, '│ v0.1 │ Testing something … │ [email protected] │ \x1B]8;;https://adobe.com\x07link\x1B]8;;\x07 │ 7 minutes ago │'
64-
, '│ v0.1 │ Testing something … │ [email protected] │ \x1B]8;;https://adobe.com\x07link\x1B]8;;\x07 │ 8 minutes ago │'
65-
, '└──────┴─────────────────────┴─────────────────────────┴─────────────────┴─────────────────┘'
66-
// '┌──────┬─────────────────────┬─────────────────────────┬─────────────────┐'
67-
// , '│ Rel │ Change │ By │ When │'
68-
// , '├──────┼─────────────────────┼─────────────────────────┼─────────────────┤'
69-
// , '│ v0.1 │ Testing something … │ [email protected] │ 7 minutes ago │'
70-
// , '├──────┼─────────────────────┼─────────────────────────┼─────────────────┤'
71-
// , '│ v0.1 │ Testing something … │ [email protected] │ 8 minutes ago │'
72-
// , '└──────┴─────────────────────┴─────────────────────────┴─────────────────┘'
73-
];
74-
75-
table.toString().should.eql(expected.join("\n"));
76-
},
77-
7846
'test width property': function (){
7947
var table = new Table({
8048
head: ['Cool'],

0 commit comments

Comments
 (0)