Skip to content

Commit

Permalink
Remove references to promise
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Johansen committed Feb 8, 2012
1 parent d151865 commit 75057c4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
12 changes: 6 additions & 6 deletions site/docs/args.html
Expand Up @@ -337,22 +337,22 @@ <h3 id="async-validators">Asynchronous validators</h3>
Promises are used to facilitate asynchronous validators. Here's an example Promises are used to facilitate asynchronous validators. Here's an example
of a validator that checks if a file is larger than 1MB. of a validator that checks if a file is larger than 1MB.
</p> </p>
<pre><code>var busterPromise = require("buster-promise"); <pre><code>var when = require("when");
opt.addValidator(function () { opt.addValidator(function () {
var self = this; var self = this;
var promise = busterPromise.create(); var deferred = when.defer();
fs.stat(this.value(), function (err, stat) { fs.stat(this.value(), function (err, stat) {
if (err) { if (err) {
promise.reject("Unknown error: " + err); deferred.resolver.reject("Unknown error: " + err);
} }


if (stat.size > 1024) { if (stat.size > 1024) {
promise.reject(self.value() + " (" + self.signature + ") was larger than 1MB"); deferred.resolver.reject(self.value() + " (" + self.signature + ") was larger than 1MB");
} else { } else {
promise.resolve(); deferred.resolver.resolve();
} }
}); });
return promise; return deferred.promise;
});</code></pre> });</code></pre>
<p> <p>
Given <kbd>--myopt /path/to/file</kbd> and the file is larger than 1MB, Given <kbd>--myopt /path/to/file</kbd> and the file is larger than 1MB,
Expand Down
6 changes: 3 additions & 3 deletions site/docs/client/client.html
Expand Up @@ -19,7 +19,7 @@ <h3 id="create" data-title="+create(port, host, path);+"><code>var client = bust
running <a href="/buster-capture-server/">buster-capture-server</a>. running <a href="/buster-capture-server/">buster-capture-server</a>.
</p> </p>
<h3 id="createSession" data-title="+createSession(config);+"> <h3 id="createSession" data-title="+createSession(config);+">
<code>var <a href="/buster-promise/">promise</a> = client.createSession(<a href="#options">options</a>);</code> <code>var promise = client.createSession(<a href="#options">options</a>);</code>
</h3> </h3>
<p> <p>
Creates and runs a new session on the server. The provided resource set Creates and runs a new session on the server. The provided resource set
Expand Down Expand Up @@ -47,14 +47,14 @@ <h3 id="createSession" data-title="+createSession(config);+">
// Use session // Use session
});</code></pre> });</code></pre>
<h3 id="getCachedResources" data-title="+getCachedResources();+"> <h3 id="getCachedResources" data-title="+getCachedResources();+">
<code>var <a href="/buster-promise/">promise</a> = client.getCachedResources();</code> <code>var promise = client.getCachedResources();</code>
</h3> </h3>
<p> <p>
Fetches a list of resources cached on the server. These can optionally be Fetches a list of resources cached on the server. These can optionally be
reused if their content has not changed. The returned promise is resolved reused if their content has not changed. The returned promise is resolved
with a <a href="#cachedResources"><code>cachedResources</code></a> object when ready. with a <a href="#cachedResources"><code>cachedResources</code></a> object when ready.
</p> </p>
<h3 id="useCachedResources" data-title="+useCachedResources(config);+"><code>var <a href="/buster-promise/">promise</a> = client.useCachedResources(<a href="/buster-client/session-config/#formatted-session-config">config</a>);</code></h3> <h3 id="useCachedResources" data-title="+useCachedResources(config);+"><code>var promise = client.useCachedResources(<a href="/buster-client/session-config/#formatted-session-config">config</a>);</code></h3>
<p> <p>
Tweak the session configuration to use cached resources where possible. Tweak the session configuration to use cached resources where possible.
</p> </p>
Expand Down
2 changes: 1 addition & 1 deletion site/docs/client/session.html
Expand Up @@ -33,7 +33,7 @@ <h3 id="emit"><code>emit(event, data);</code></h3>
<a href="/buster-multicast/#on"><code>buster.multicast.emit</code></a> for <a href="/buster-multicast/#on"><code>buster.multicast.emit</code></a> for
details. details.
</p> </p>
<h3 id="close" data-title="+close();+"><code>var <a href="/buster-promise/">promise</a> = session.close();</code></h3> <h3 id="close" data-title="+close();+"><code>var promise = session.close();</code></h3>
<p> <p>
Close session. Sends a HTTP request to the server. Returns a promise that Close session. Sends a HTTP request to the server. Returns a promise that
will resolve once the session has been removed from the server. will resolve once the session has been removed from the server.
Expand Down
2 changes: 0 additions & 2 deletions site/docs/test/stack-filter.html
Expand Up @@ -41,8 +41,6 @@ <h3 id="stackFilter" data-title="+stackFilter(stack[, cwd])+">
'at asyncFunction (/home/christian/buster/node_modules/buster-test/lib/buster-test/runner.js:79:21)' + 'at asyncFunction (/home/christian/buster/node_modules/buster-test/lib/buster-test/runner.js:79:21)' +
'at Object.runTestFunction (/home/christian/buster/node_modules/buster-test/lib/buster-test/runner.js:312:26)' + 'at Object.runTestFunction (/home/christian/buster/node_modules/buster-test/lib/buster-test/runner.js:312:26)' +
'at /home/christian/buster/node_modules/buster-core/lib/buster-core.js:45:31' + 'at /home/christian/buster/node_modules/buster-core/lib/buster-core.js:45:31' +
'at runOne (/home/christian/buster/node_modules/buster-promise/lib/buster-promise.js:89:35)' +
'at Array.0 (/home/christian/buster/node_modules/buster-promise/lib/buster-promise.js:75:47)' +
'at EventEmitter._tickCallback (node.js:108:26)';</code></pre> 'at EventEmitter._tickCallback (node.js:108:26)';</code></pre>
<p><code>stackFilter</code> would reduce it like so:</p> <p><code>stackFilter</code> would reduce it like so:</p>
<pre><code>var lines = buster.stackFilter(stack, "/home/christian/buster"); <pre><code>var lines = buster.stackFilter(stack, "/home/christian/buster");
Expand Down

0 comments on commit 75057c4

Please sign in to comment.