This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
fluently /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Jan 23 11:08:37 -0800 2008 | [osteele] |
| |
.gitmodules | Sun Apr 13 04:23:51 -0700 2008 | [osteele] |
| |
MIT-LICENSE | Wed Jan 23 14:42:23 -0800 2008 | [osteele] |
| |
README | Thu Feb 14 11:45:23 -0800 2008 | [osteele] |
| |
Rakefile | Thu Feb 14 11:45:23 -0800 2008 | [osteele] |
| |
VERSION | Thu Feb 14 11:45:23 -0800 2008 | [osteele] |
| |
agenda.txt | Thu Feb 14 11:45:23 -0800 2008 | [osteele] |
| |
examples/ | Wed Jan 23 11:09:32 -0800 2008 | [osteele] |
| |
fluently.js | Thu Feb 14 11:45:23 -0800 2008 | [osteele] |
| |
jsspec &rarr f5758f9 | Sun Apr 13 04:23:51 -0700 2008 | [osteele] |
| |
specs/ | Sun Apr 13 04:23:28 -0700 2008 | [osteele] |
README
= About Fluently is a JavaScript toolkit for creating FluentInterfaces[http://martinfowler.com/bliki/FluentInterface.html]. I use this to define the mocks, stubs, and expectations in LzTestKit[http://osteele.com/sources/openlaszlo/lztestkit]. = Status Alpha. I use this in other projects, but it's got a known bug (chained modifiers ignore all but the last one), and the API isn't final. = Examples With Fluently, you can do this: var o = Fluently.make(function(define) { define('fn1', function() {console.info('called fn1')}); define('fn2', function() {console.info('called fn2')}); define('fn3', function() {return 3}); }); to define an object with chained methods, that can be invoked thus: o.fn1().fn2() // calls fn1 and then fn2 o.fn2().fn1() // calls fn2 and then fn1 o.fn1().fn3() // returns 3 (an explicit 'return' breaks the chain) You can also define modifiers, and aliases: var o = Fluently.make(function(define) { define('fn1', function() {console.info('called fn1')}); define('fn2', function() {console.info('called fn2')}); define.empty('and'); define.alias('fn3', 'fn1'); define.modifier('not'); }); o.fn3(); // same as o.fn1() o.fn1().and.fn2() // same as o.fn1().fn2() o.fn1().and.not.fn2() // options.not is set when fn2 is called I've extracted a couple of files, from LzTestKit, into the examples[http://osteele.com/sources/javascript/fluently/examples/] directory. These don't run on their own, but at least they show the code in use. You can also see a range of examples by viewing the specs[http://osteele.com/sources/javascript/fluently/specs/fluently-specs.js]. = Download Get it here: {download-location}. = License Fluently is licensed under the MIT License. This package includes a distribution of jsspec, which is licensed under the LGPL.




