Skip to content

Commit

Permalink
Merge pull request #21 from RobLoach/daviddm
Browse files Browse the repository at this point in the history
Add David-DM support
  • Loading branch information
RobLoach committed Dec 31, 2013
2 parents 5b25278 + 567d049 commit cb54c92
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 17 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

[![Build Status](http://img.shields.io/travis-ci/bevry/projectz.png?branch=master)](http://travis-ci.org/bevry/projectz "Check this project's build status on TravisCI")
[![NPM version](http://badge.fury.io/js/projectz.png)](https://npmjs.org/package/projectz "View this project on NPM")
[![Dependency Status](https://david-dm.org/bevry/projectz.png)](https://david-dm.org/bevry/projectz)
[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip")
[![Flattr donate button](http://img.shields.io/flattr/donate.png?color=yellow)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr")
[![PayPayl donate button](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal")
Expand Down Expand Up @@ -120,6 +121,7 @@ The special fields are as so:
badges:
travis: true
npm: true
daviddm: true
gittip: true
flattr: "344188/balupton-on-Flattr"
paypal: "QB8GQPZAH84N6"
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"main": "./out/lib/projectz.js",
"scripts": {
"test": "echo 'no tests yet'",
"test": "bin/projectz compile -p test/src",
"start": "node ./node_modules/coffee-script/bin/cake watch"
},
"bin": {
Expand All @@ -62,6 +62,7 @@
"badges": {
"travis": true,
"npm": true,
"daviddm": true,
"gittip": "bevry",
"flattr": "344188/balupton-on-Flattr",
"paypal": "QB8GQPZAH84N6"
Expand Down
17 changes: 17 additions & 0 deletions src/lib/badge-util.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ module.exports = badgeUtil =
[![NPM version](http://badge.fury.io/js/#{opts.name}.png)](https://npmjs.org/package/#{opts.name} "View this project on NPM")
"""

# Get David DM
daviddm: (opts={}) ->
# Check
return '' if !opts.badges.daviddm

# Use the repo value, if it's available, and daviddm is simply "true".
if opts.badges.daviddm is true and (opts.repo or false)
url = "https://david-dm.org/#{opts.repo}"
else
# Otherwise, assume it's the github repository name.
url = "https://david-dm.org/#{opts.badges.daviddm}"

# Return
return """
[![Dependency Status](#{url}.png)](#{url})
"""

donationBadges:
# Get Gittip Badge
gittip: (opts={}) ->
Expand Down
95 changes: 87 additions & 8 deletions test/src/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
<!-- TTITLE -->
<!-- BADGES -->
<!-- DESCRIPTION -->
<!-- TITLE -->

<!-- BADGES/ -->

[![Build Status](http://img.shields.io/travis-ci/bevry/ambi.png?branch=master)](http://travis-ci.org/bevry/ambi "Check this project's build status on TravisCI")
[![Dependency Status](https://david-dm.org/bevry/ambi.png)](https://david-dm.org/bevry/ambi)
[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip")
[![Flattr donate button](http://img.shields.io/flattr/donate.png?color=yellow)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr")
[![PayPayl donate button](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal")

<!-- /BADGES -->


<!-- DESCRIPTION/ -->

Execute a function ambidextrously (normalizes the differences between synchronous and asynchronous functions). Useful for treating synchronous functions as asynchronous functions (like supporting both synchronous and asynchronous event definitions automatically).

<!-- /DESCRIPTION -->


## Usage
Expand Down Expand Up @@ -51,8 +66,72 @@ console.log(result); // setTimeout - just like normal
- Ambi can also introspect a different method than the one it fires, by passing `[methodToFire, methodToIntrospect]` as the `method` argument


<!-- INSTALL -->
<!-- HISTORY -->
<!-- CONTRIBUTE -->
<!-- BACKERS -->
<!-- LICENSE -->
<!-- INSTALL/ -->

## Install

### [Node](http://nodejs.org/)
- Use: `require('ambi')`
- Install: `npm install --save ambi`

<!-- /INSTALL -->


<!-- HISTORY/ -->

## History
[Discover the change history by heading on over to the `HISTORY.md` file.](https://github.com/bevry/ambi/blob/master/HISTORY.md#files)

<!-- /HISTORY -->


<!-- CONTRIBUTE/ -->

## Contribute

[Discover how you can contribute by heading on over to the `CONTRIBUTING.md` file.](https://github.com/bevry/ambi/blob/master/CONTRIBUTING.md#files)

<!-- /CONTRIBUTE -->


<!-- BACKERS/ -->

## Backers

### Maintainers

These amazing people are maintaining this project:

- Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)

### Sponsors

No sponsors yet! Will you be the first?

[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip")
[![Flattr donate button](http://img.shields.io/flattr/donate.png?color=yellow)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr")
[![PayPayl donate button](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal")

### Contributors

These amazing people have contributed code to this project:

- [Benjamin Lupton](https://github.com/balupton) <b@lupton.cc>[view contributions](https://github.com/bevry/ambi/commits?author=balupton)
- [sfrdmn](https://github.com/sfrdmn)[view contributions](https://github.com/bevry/ambi/commits?author=sfrdmn)

[Become a contributor!](https://github.com/bevry/ambi/blob/master/CONTRIBUTING.md#files)

<!-- /BACKERS -->


<!-- LICENSE/ -->

## License

Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://creativecommons.org/licenses/MIT/)

Copyright &copy; Bevry Pty Ltd <us@bevry.me> (http://bevry.me)

<!-- /LICENSE -->


7 changes: 5 additions & 2 deletions test/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)"
],
"contributors": [
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)"
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)",
"sfrdmn (https://github.com/sfrdmn)"
],
"bugs": {
"url": "https://github.com/bevry/ambi/issues"
Expand All @@ -26,7 +27,9 @@
"type": "git",
"url": "http://github.com/bevry/ambi.git"
},
"license": "MIT",
"license": {
"type": "MIT"
},
"engines": {
"node": ">=0.8"
},
Expand Down
12 changes: 6 additions & 6 deletions test/src/projectz.cson
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
version: "2.1.4"
license: "MIT"
description: "Execute a function ambidextrously (normalizes the differences between synchronous and asynchronous functions). Useful for treating synchronous functions as asynchronous functions (like supporting both synchronous and asynchronous event definitions automatically)."
keywords: "keywords, for, ambi"
keywords: "sync,async,fire,exec,execute,ambidextrous,flow"
authors: """
2013+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me)
2011-2012 Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)
Bevry Pty Ltd <us@bevry.me> (http://bevry.me)
"""
maintainers: """
Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)
Expand All @@ -21,6 +20,7 @@
gittip: 'bevry'
flattr: '344188/balupton-on-Flattr'
paypal: 'QB8GQPZAH84N6'
daviddm: true
dependencies:
"typechecker": "~2.0.6"
devDependencies:
Expand All @@ -29,13 +29,13 @@
"joe-reporter-console": "~1.2.0"
"chai": "~1.7.2"
engines:
node: ">0.4"
node: ">=0.8"
directories:
lib: './out/lib'
scripts:
preinstall: "node ./cyclic.js"
test: "node ./out/text/everything-test.js"
main: "./out/ambi.js"
main: "./out/lib/ambi.js"

# auto detected and enhanced
# - homepage
Expand Down Expand Up @@ -67,4 +67,4 @@
backers: true
license: true
readme: true
}
}

0 comments on commit cb54c92

Please sign in to comment.