Browse files

using testling, readme upgrade

  • Loading branch information...
1 parent b3785f2 commit 7f1c97eec820b8eb9e6e6e098fc9d5405cc13b72 @substack committed Dec 17, 2012
Showing with 28 additions and 54 deletions.
  1. +10 −0 package.json
  2. +18 −31 README.markdown → readme.markdown
  3. +0 −23 testling/test.sh
View
10 package.json
@@ -20,5 +20,15 @@
"scripts": {
"test": "tap test/*.js"
},
+ "testling" : {
+ "files" : "test/*.js",
+ "browsers" : {
+ "iexplore" : [ "6.0", "7.0", "8.0", "9.0" ],
+ "chrome" : [ "10.0", "20.0" ],
+ "firefox" : [ "10.0", "15.0" ],
+ "safari" : [ "5.1" ],
+ "opera" : [ "12.0" ]
+ }
+ },
"license" : "MIT"
}
View
49 README.markdown → readme.markdown
@@ -1,15 +1,15 @@
-dnode-protocol
-==============
+# dnode-protocol
This module implements the dnode protocol in a reusable form that is presently
used for both the server-side and browser-side dnode code.
-[Read about the protocol itself here.](https://github.com/substack/dnode-protocol/blob/master/doc/protocol.markdown)
+[![browser support](http://ci.testling.com/substack/dnode-protocol.png)](http://ci.testling.com/substack/dnode-protocol)
[![build status](https://secure.travis-ci.org/substack/dnode-protocol.png)](http://travis-ci.org/substack/dnode-protocol)
-example
-=======
+[Read about the protocol itself here.](https://github.com/substack/dnode-protocol/blob/master/doc/protocol.markdown)
+
+# example
``` js
var proto = require('dnode-protocol');
@@ -43,15 +43,13 @@ f(5)
g(6)
```
-methods
-=======
+# methods
``` js
var protocol = require('dnode-protocol')
```
-var proto = protocol(cons, opts={})
------------------------------------
+## var proto = protocol(cons, opts={})
Create a new protocol object with a constructor `cons` and an optional callback
wrapper `wrap`.
@@ -73,67 +71,56 @@ The return value of `opts.wrap(cb, id)` will be stored in `proto.callbacks.remot
and `opts.unwrap(ref, id)` will be called with the `ref` obtained from `wrap()`
previously to turn `ref` back into a `cb`.
-proto.handle(req)
------------------
+## proto.handle(req)
Handle a request object emitted by the request event, calling the method the
request mentions with the provided arguments.
-proto.request(method, args)
----------------------------
+## proto.request(method, args)
Emit a request event for the method id `method` and the raw arguments `args`.
The args will be scrubbed for callbacks and emitted in normal form suitable for
passing to `JSON.stringify()`.
-proto.start()
--------------
+## proto.start()
Begin the methods exchange. All listeners should be bound before this function
is called.
-proto.cull(id)
---------------
+## proto.cull(id)
Instruct the opposing connection to drop all references to the callback
specified by `id`.
-events
-======
+# events
-proto.on('request', function (req) { ... })
--------------------------------------------
+## proto.on('request', function (req) { ... })
Emitted when a request is ready to be sent.
The request should be serialized and passed to the opposing connection's
`.handle()`.
-proto.on('remote', function (remote) { ... })
----------------------------------------------
+## proto.on('remote', function (remote) { ... })
Emitted when the remote reference has been populated.
-proto.on('fail', function (err) { ... })
-----------------------------------------
+## proto.on('fail', function (err) { ... })
Emitted when there is a non-fatal failed request.
-proto.on('error', function (err) { ... })
------------------------------------------
+## proto.on('error', function (err) { ... })
Emitted when there is a fatal exception one of the local callbacks.
-install
-=======
+# install
With [npm](http://npmjs.org) do:
```
npm install dnode-protocol
```
-license
-=======
+# license
MIT
View
23 testling/test.sh
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-if test -z "$user"; then
- echo -n "username: "
- read user
-fi
-
-browsers=""
-if test -n "$2"; then
- browsers="browsers=$2"
-fi
-
-function testFile {
- tar -cf- index.js "$1" node_modules/traverse/index.js \
- | curl -u "$user" -sSNT- \
- "http://testling.com/?$browsers&main=$1"
-}
-
-if test -f "$1"; then
- testFile "$1"
-else
- echo not
-fi

0 comments on commit 7f1c97e

Please sign in to comment.