Skip to content

Commit

Permalink
fixes #57, make now runs the xamples, better example output
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoffer Hallas committed Mar 13, 2014
1 parent ab8d4ea commit c327699
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

test:
@echo "populate me"
EXAMPLES = $(foreach EXAMPLE, $(wildcard examples/*.js), $(EXAMPLE))
.PHONY: $(EXAMPLES)
$(EXAMPLES): ; node $@ && echo

.PHONY: test
.PHONY: test
test: $(EXAMPLES)
2 changes: 1 addition & 1 deletion examples/backnforth.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

var ProgressBar = require('../');

var bar = new ProgressBar(':title [:bar] :percent', {
var bar = new ProgressBar(' :title [:bar] :percent', {
complete: '='
, incomplete: ' '
, width: 30
Expand Down
3 changes: 1 addition & 2 deletions examples/exact.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

var ProgressBar = require('../');

var bar = new ProgressBar('progress [:bar] :percent :etas', {
var bar = new ProgressBar(' progress [:bar] :percent :etas', {
complete: '='
, incomplete: ' '
, width: 40
Expand All @@ -19,7 +19,6 @@ var i = 0, steps = [0.1, 0.25, 0.6, 0.8, 0.4, 0.5, 0.6, 0.2, 0.8, 1.0];

(function next() {
if (i >= steps.length) {
console.log();
} else {
bar.update(steps[i++]);
setTimeout(next, 500);
Expand Down
1 change: 0 additions & 1 deletion examples/formats.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ var ProgressBar = require('../');

var bar = new ProgressBar(' :bar :title', { total: 10 });

console.log();
var id = setInterval(function(){
var randomTitle = ['some', 'random', 'title'][Math.random() * 3 | 0];
bar.tick({ title: randomTitle });
Expand Down
2 changes: 1 addition & 1 deletion examples/simple.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var ProgressBar = require('../')
, bar = new ProgressBar('[:bar]', 10);
, bar = new ProgressBar(' [:bar]', 10);

var id = setInterval(function (){
bar.tick();
Expand Down

0 comments on commit c327699

Please sign in to comment.