Skip to content

Commit

Permalink
first few tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Jul 4, 2013
0 parents commit 2357a43
Show file tree
Hide file tree
Showing 12 changed files with 193 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.DS_Store
*.log
node_modules
build
*.node
components
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.DS_Store
*.log
node_modules
build
*.node
components
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: node_js
node_js:
- 0.6
- 0.7
- 0.8
- 0.9
- 0.10
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2013 Fractal <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[![Build Status](https://travis-ci.org/wearefractal/gulp.png?branch=master)](https://travis-ci.org/wearefractal/gulp)

## Information

<table>
<tr>
<td>Package</td><td>gulp</td>
</tr>
<tr>
<td>Description</td>
<td>DESCRIPTIONHERE</td>
</tr>
<tr>
<td>Node Version</td>
<td>>= 0.4</td>
</tr>
</table>

## Usage

```coffee-script
NOTHING HERE YET
```

## LICENSE

(MIT License)

Copyright (c) 2013 Fractal <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Empty file added bin/cli.coffee
Empty file.
4 changes: 4 additions & 0 deletions bin/gulp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node

require('coffee-script');
require('./cli');
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('coffee-script');
module.exports = require('./lib/main');
2 changes: 2 additions & 0 deletions lib/createFilesStream.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module.exports = (glob, opt) ->

25 changes: 25 additions & 0 deletions lib/main.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
async = require 'async'
#createFolderStream = require './createFolderStream'
createFilesStream = require './createFilesStream'
#createFileStream = require './createFileStream'

module.exports = gulp =
reset: ->
gulp.tasks = {}
return @

tasks: {}
task: (name, fn) ->
gulp.tasks[name] = fn
return @

run: (tasks...) ->
for name in tasks
fn = gulp.tasks[name]
throw new Error "No task nmed #{name}" unless fn?
fn.call gulp
return @

#folder: createFolderStream
files: createFilesStream
#file: createFileStream
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name":"gulp",
"description":"DESCRIPTIONHERE",
"version":"0.0.1",
"homepage":"http://github.com/wearefractal/gulp",
"repository":"git://github.com/wearefractal/gulp.git",
"author":"Fractal <[email protected]> (http://wearefractal.com/)",
"main":"./index.js",

"dependencies":{
"coffee-script":"*",
"async":"*"
},
"devDependencies":{
"mocha":"*",
"should":"*"
},
"scripts":{
"test":"mocha --compilers coffee:coffee-script"
},
"engines":{
"node":">= 0.4.0"
},
"licenses":[
{
"type":"MIT",
"url":"http://github.com/wearefractal/gulp/raw/master/LICENSE"
}
]
}
43 changes: 43 additions & 0 deletions test/main.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
gulp = require '../'
should = require 'should'
require 'mocha'

describe 'gulp', ->
describe 'task()', ->
it 'should define a task', (done) ->
fn = ->

gulp.task 'test', fn
should.exist gulp.tasks.test
gulp.tasks.test.should.equal fn
gulp.reset()
done()

describe 'run()', ->
it 'should run multiple tasks', (done) ->
a = 0
fn = ->
@.should.equal gulp
++a
fn2 = ->
@.should.equal gulp
++a

gulp.task 'test', fn
gulp.task 'test2', fn2
gulp.run 'test', 'test2'
a.should.equal 2
gulp.reset()
done()

it 'should run task scoped to gulp', (done) ->
a = 0
fn = ->
@.should.equal gulp
++a

gulp.task 'test', fn
gulp.run 'test'
a.should.equal 1
gulp.reset()
done()

0 comments on commit 2357a43

Please sign in to comment.