Permalink
Browse files

using travis, s/Chainsaw/chainsaw/

  • Loading branch information...
1 parent 3c74751 commit a88c8f20a343b7cabc903d5ede15632d348e941f @substack committed Apr 16, 2012
Showing with 20 additions and 14 deletions.
  1. +4 −0 .travis.yml
  2. +12 −10 README.markdown
  3. +2 −2 examples/add_do.js
  4. +2 −2 examples/prompt.js
View
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
View
@@ -1,13 +1,15 @@
-Chainsaw
+chainsaw
========
Build chainable fluent interfaces the easy way in node.js.
+[![build status](https://secure.travis-ci.org/substack/node-chainsaw.png)](http://travis-ci.org/substack/node-chainsaw)
+
With this meta-module you can write modules with chainable interfaces.
Chainsaw takes care of all of the boring details and makes nested flow control
super simple too.
-Just call `Chainsaw` with a constructor function like in the examples below.
+Just call `chainsaw` with a constructor function like in the examples below.
In your methods, just do `saw.next()` to move along to the next event and
`saw.nest()` to create a nested chain.
@@ -21,10 +23,10 @@ add_do.js
This silly example adds values with a chainsaw.
- var Chainsaw = require('chainsaw');
+ var chainsaw = require('chainsaw');
function AddDo (sum) {
- return Chainsaw(function (saw) {
+ return chainsaw(function (saw) {
this.add = function (n) {
sum += n;
saw.next();
@@ -56,14 +58,14 @@ prompt.js
This example provides a wrapper on top of stdin with the help of
[node-lazy](https://github.com/pkrumins/node-lazy) for line-processing.
- var Chainsaw = require('chainsaw');
- var Lazy = require('lazy');
+ var chainsaw = require('chainsaw');
+ var lazy = require('lazy');
module.exports = Prompt;
function Prompt (stream) {
var waiting = [];
var lines = [];
- var lazy = Lazy(stream).lines.map(String)
+ var lazy = lazy(stream).lines.map(String)
.forEach(function (line) {
if (waiting.length) {
var w = waiting.shift();
@@ -74,7 +76,7 @@ This example provides a wrapper on top of stdin with the help of
;
var vars = {};
- return Chainsaw(function (saw) {
+ return chainsaw(function (saw) {
this.getline = function (f) {
var g = function (line) {
saw.nest(f, line, vars);
@@ -153,7 +155,7 @@ consume a tremendous amount of memory, so we also offer a "light" mode
where actions are not recorded and the aforementioned methods are
disabled.
-To enable light mode simply use `Chainsaw.light()` to construct your
-saw, instead of `Chainsaw()`.
+To enable light mode simply use `chainsaw.light()` to construct your
+saw, instead of `chainsaw()`.
View
@@ -1,7 +1,7 @@
-var Chainsaw = require('chainsaw');
+var chainsaw = require('chainsaw');
function AddDo (sum) {
- return Chainsaw(function (saw) {
+ return chainsaw(function (saw) {
this.add = function (n) {
sum += n;
saw.next();
View
@@ -1,4 +1,4 @@
-var Chainsaw = require('chainsaw');
+var chainsaw = require('chainsaw');
var Lazy = require('lazy');
module.exports = Prompt;
@@ -16,7 +16,7 @@ function Prompt (stream) {
;
var vars = {};
- return Chainsaw(function (saw) {
+ return chainsaw(function (saw) {
this.getline = function (f) {
var g = function (line) {
saw.nest(f, line, vars);

0 comments on commit a88c8f2

Please sign in to comment.