Skip to content

Commit

Permalink
Update interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlangberg committed Sep 20, 2015
1 parent 0856cce commit 8402d94
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 29 deletions.
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
# 3.0.0 (2015-30-05)
# 4.0.0 (2015-09-20)

## Breaking changes

-- Change from factory to object to make testing easier. ```require``` will now work differently. See example in README.

# 3.0.0 (2015-05-30)

## Breaking changes

-- Change from singleton to factory. ```require``` will now work differently. See example in README.

# 2.0.0 (2015-30-05)
# 2.0.0 (2015-05-30)

## Breaking changes

-- Change from plugin to module. ```require``` will now work differently. See example in README.

# 1.0.0 (2015-30-05)
# 1.0.0 (2015-05-30)

## Features

-- First release.

# 0.0.1 (2015-28-05)
# 0.0.1 (2015-05-28)

## Features

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ npm install goldwasher-schedule

```javascript
var goldwasher = require('goldwasher-schedule');
var gs = goldwasher(targets, options, callback);
var gs = goldwasher.setup(targets, options, callback);
gs.start();
gs.stop();
```
Expand Down Expand Up @@ -96,7 +96,7 @@ var targets = [
];

// set up the schedule
gs(targets, function(error, results) {
gs.setup(targets, function(error, results) {
console.log(results);
}).start();
```
Expand Down Expand Up @@ -130,7 +130,7 @@ var processResults = function(error, results) {
};

// set up the schedule
var gs = goldwasher(targets, options, processResults);
var gs = goldwasher.setup(targets, options, processResults);

// start the schedule
gs.start();
Expand Down
10 changes: 2 additions & 8 deletions docs/goldwasher-schedule.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,7 @@ <h1 class="page-title">Source: goldwasher-schedule.js</h1>
}, _this.jobs);
};

module.exports = function(targets, userOptions, callback) {
var gs = Object.create(schedule);

gs.setup(targets, userOptions, callback);

return gs;
};
module.exports = schedule;
</code></pre>
</article>
</section>
Expand All @@ -131,7 +125,7 @@ <h2><a href="index.html">Index</a></h2>
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Sun Sep 13 2015 15:01:28 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Sun Sep 20 2015 18:34:13 GMT+0200 (CEST)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ <h2><a href="index.html">Index</a></h2>
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Sun Sep 13 2015 15:01:28 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Sun Sep 20 2015 18:34:13 GMT+0200 (CEST)
</footer>

<script> prettyPrint(); </script>
Expand Down
8 changes: 1 addition & 7 deletions lib/goldwasher-schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,4 @@ schedule.stop = function() {
}, _this.jobs);
};

module.exports = function(targets, userOptions, callback) {
var gs = Object.create(schedule);

gs.setup(targets, userOptions, callback);

return gs;
};
module.exports = schedule;
12 changes: 6 additions & 6 deletions test/goldwasher-schedule.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ after(function() {
describe('initialization', function() {

it('loads without options', function(done) {
goldwasher(targets, function() {
goldwasher.setup(targets, function() {
});

done();
});

it('accepts options', function(done) {
goldwasher(targets, options, function() {
goldwasher.setup(targets, options, function() {
});

done();
});

it('passes down options', function(done) {
var gs = goldwasher(targets, options, function() {
var gs = goldwasher.setup(targets, options, function() {
});

gs.options.should.have.property('goldwasher');
Expand All @@ -72,7 +72,7 @@ describe('initialization', function() {
describe('running', function() {

it('runs and stops', function(done) {
var gs = goldwasher(targets, options, function(error, results) {
var gs = goldwasher.setup(targets, options, function(error, results) {
results.length.should.be.greaterThan(0);
gs.stop();
done();
Expand All @@ -90,7 +90,7 @@ describe('running', function() {
}
];

var gs = goldwasher(
var gs = goldwasher.setup(
targets,
options,
function(error, results, target) {
Expand All @@ -106,7 +106,7 @@ describe('running', function() {

it('returns error on goldwasher-needle failure', function(done) {
var targets = [{url: 'foo'}];
var gs = goldwasher(targets, options, function(error, results) {
var gs = goldwasher.setup(targets, options, function(error, results) {
should.exist(error);
gs.stop();
done();
Expand Down

0 comments on commit 8402d94

Please sign in to comment.