Skip to content

Commit

Permalink
1.2.5
Browse files Browse the repository at this point in the history
- updates dependencies
- fixes db having a default address
  • Loading branch information
gabrielcsapo committed Jan 13, 2018
1 parent 043a6c0 commit 813f550
Show file tree
Hide file tree
Showing 10 changed files with 2,330 additions and 41 deletions.
4 changes: 3 additions & 1 deletion tryitout.js → .tryitout
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ module.exports = {
Docs: './code/index.html',
Storybook: './storybook/index.html',
Example: 'http://lcov-server.gabrielcsapo.com'
}
},
output: './docs',
template: 'product'
};
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.2.5 (01/12/2018)

- updates dependencies
- fixes db having a default address

# 1.2.4 (12/07/2017)

- fixes prepublish step
Expand Down
5 changes: 2 additions & 3 deletions bin/lcov-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ args.forEach((a, i) => {
Usage: lcov-server [options]
Commands:
upload, --upload, -u [server ] Set the url to upload lcov data too (default: http://localhost:8080)
serve, -s, --serve Pass this option to startup a lcov-server instance
version, -v, --version output the version number
Expand Down Expand Up @@ -77,9 +77,8 @@ args.forEach((a, i) => {

const { parser, upload, serve, db, basePath } = program;


if(serve) {
process.env.MONGO_URL = process.env.MONGO_URL || db;
process.env.MONGO_URL = process.env.MONGO_URL || db || 'mongodb://localhost:32768/lcov-server';

require('../index');
} else {
Expand Down
14 changes: 7 additions & 7 deletions dist/bundle.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions docs/code/ci.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ <h1 class="page-title">ci.js</h1>
options.service_name = 'travis-ci';
options.service_job_id = process.env.TRAVIS_JOB_ID;
options.service_pull_request = process.env.TRAVIS_PULL_REQUEST;
options.commit = 'HEAD';
options.message = process.env.TRAVIS_COMMIT_MESSAGE;
options.branch = process.env.TRAVIS_BRANCH || process.env.TRAVIS_PULL_REQUEST_BRANCH;
options.branch = process.env.TRAVIS_BRANCH || process.env.TRAVIS_PULL_REQUEST_BRANCH || process.env.TRAVIS_TAG;
}

if (process.env.DRONE){
Expand Down
27 changes: 22 additions & 5 deletions docs/code/coverage.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,12 @@ <h1 class="page-title">coverage.js</h1>
Coverage.aggregate(options, (err, docs) => {
if(err) { return reject(err); }
// this might happen if the data is malformed
if(docs.length > 1) {
if(docs.length == 1) {
docs[0].history = docs[0].history.sort((a, b) => {
return moment(a['run_at']) - moment(b['run_at']) > 0 ? -1 : 1;
});
return resolve(docs);
} else if(docs.length > 1){
var condensed = docs[0];
for(var i = 1; i &lt; docs.length; i++) {
condensed.history = condensed.history.concat(docs[i].history);
Expand All @@ -228,14 +233,26 @@ <h1 class="page-title">coverage.js</h1>
return moment(a['run_at']) - moment(b['run_at']) > 0 ? -1 : 1;
});
return resolve([condensed]);
} else {
return reject('no coverage was found');
}
docs[0].history = docs[0].history.sort((a, b) => {
return moment(a['run_at']) - moment(b['run_at']) > 0 ? -1 : 1;
});
return resolve(docs);
});
});
};

module.exports.feed = function feed(limit=10) {
return new Promise((resolve, reject) => {
let options = [
{ $sort: { "run_at": -1 } },
{ $limit: parseInt(limit) }
];

Coverage.aggregate(options, (err, docs) => {
if(err) { return reject(err); }
return resolve(docs);
});
});
};
</code></pre>
</article>
</section>
Expand Down
16 changes: 9 additions & 7 deletions docs/code/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,18 @@ <h1>Prerequisites</h1><ul>
</ul>
<h1>Install</h1><pre class="prettyprint source"><code>npm install lcov-server -g</code></pre><h1>Usage</h1><pre class="prettyprint source"><code>Usage: lcov-server [options]

Commands:

upload, --upload, -u [server ] Set the url to upload lcov data too (default: http://localhost:8080)
serve, -s, --serve Pass this option to startup a lcov-server instance
version, -v, --version output the version number
help, -h, --help output usage information

Options:

-V, --version output the version number
-u, --upload [server] Set the url to upload lcov data too
-s, --serve Pass this option to startup a lcov-server instance
-d, --db [db] Set the db connection
-p, --parser &lt;parser> Set the parser value [lcov, cobertura, golang, jacoco], defaults to lcov
-bp, --basePath &lt;path> The path that defines the base directory where the files that were covered will be located
-h, --help output usage information</code></pre><h2>Upload</h2><pre class="prettyprint source"><code>tap test --coverage-report=text-lcov | lcov-server --upload http://...</code></pre><h2>Server</h2><pre class="prettyprint source"><code>lcov-server --serve --db mongodb://localhost:32768/lcov-server</code></pre></article>
db, -d, --db [db] Set the db connection (default: mongodb://localhost:32768/lcov-server)
parser, -p, --parser &lt;parser> Set the parser value [lcov, cobertura, golang, jacoco], defaults to lcov (default: lcov)
basePath, -bp, --basePath &lt;path> The path that defines the base directory where the files that were covered will be located</code></pre><h2>Upload</h2><pre class="prettyprint source"><code>tap test --coverage-report=text-lcov | lcov-server --upload http://...</code></pre><h2>Server</h2><pre class="prettyprint source"><code>lcov-server --serve --db mongodb://localhost:32768/lcov-server</code></pre></article>
</section>


Expand Down
Loading

0 comments on commit 813f550

Please sign in to comment.