Permalink
Browse files

Fixed lack of JavaScript source code: CoffeeScript moved to src,

JavaScript compiled into lib, life is grand again.

Changelog is now Markdown file and part of the documentation.
  • Loading branch information...
1 parent f35b8e2 commit e05c3f6e3b567f41ae4ce00ad599ff6edf0c9257 @assaf committed Dec 22, 2010
View
@@ -1,5 +1,6 @@
.npm
-node_modules
-html
clean
+html
+lib
man1
+node_modules
View
@@ -1,53 +0,0 @@
-Version 0.6.4 2010-12-21
-
- First documentation you can actually use.
-
-
-Version 0.6.3 2010-12-21
-
- Fixed documentation link.
-
- man zombie
-
-
-Version 0.6.2 2010-12-21
-
- First NPM release.
-
- Started working on documentation site.
-
- Added cake setup to get you up and running with development dependencies.
-
- Remove Vows as runtime dependency. Use whichever framework you like. Moved
- sizzle.js from dep to vendor. Moved scripts used during tests to
- spec/.scripts.
-
- 178 tests.
- 1.8 sec to complete.
-
-
-Version 0.6.1 2010-12-20
-
- Changed browser.cookies from getter to function that accepts cookie domain
- (host and port) and path, and returns wrapper to access specific cookie
- context.
-
- Fixed: browser now creates new window for each new document.
-
- Added window.JSON.
-
- 178 tests.
- 1.8 sec to complete.
-
-
-Version 0.6.0 2010-12-20
- First release that I could use to test an existing project.
-
- Supports for navigation, filling and submitting forms, and selecting document
- content using Sizzle. Browser features include evaluating JavaScript (jQuery,
- Sammy.js), timers, XHR, cookies, local and session storage.
-
- Still very rough around the edges.
-
- 175 tests.
- 1.8 sec to complete.
View
@@ -0,0 +1,64 @@
+# CHANGELOG #
+
+### Version 0.6.5 2010-12-21
+
+Fixed lack of JavaScript source code: CoffeeScript moved to src,
+JavaScript compiled into lib, life is grand again.
+
+Changelog is now Markdown file and part of the documentation.
+
+
+### Version 0.6.4 2010-12-21
+
+First documentation you can actually use.
+
+
+### Version 0.6.3 2010-12-21
+
+Fixed documentation link.
+
+`man zombie`
+
+
+### Version 0.6.2 2010-12-21
+
+First NPM release.
+
+Started working on documentation site.
+
+Added cake setup to get you up and running with development dependencies.
+
+Remove Vows as runtime dependency. Use whichever framework you like. Moved
+sizzle.js from dep to vendor. Moved scripts used during tests to
+spec/.scripts.
+
+ 178 tests
+ 1.8 sec to complete
+
+
+### Version 0.6.1 2010-12-20
+
+Changed browser.cookies from getter to function that accepts cookie domain
+(host and port) and path, and returns wrapper to access specific cookie
+context.
+
+Fixed: browser now creates new window for each new document.
+
+Added window.JSON.
+
+ 178 tests.
+ 1.8 sec to complete.
+
+
+### Version 0.6.0 2010-12-20
+
+First release that I could use to test an existing project.
+
+Supports for navigation, filling and submitting forms, and selecting document
+content using Sizzle. Browser features include evaluating JavaScript (jQuery,
+Sammy.js), timers, XHR, cookies, local and session storage.
+
+Still very rough around the edges.
+
+ 175 tests.
+ 1.8 sec to complete.
View
111 Cakefile
@@ -13,41 +13,64 @@ reset = "\033[0m"
log = (message, color, explanation) ->
console.log color + message + reset + ' ' + (explanation or '')
-task "clean", "Remove temporary files and such", ->
- exec "rm -rf html clean man1"
+# Handle error, do nothing if null
+onerror = (err)->
+ if err
+ log err.stack, red
+ process.exit -1
-# Setup
-# -----
+## Setup ##
# Setup development dependencies, not part of runtime dependencies.
task "setup", "Install development dependencies", ->
log "Need Vows and Express to run test suite, installing ...", green
- exec "npm install \"vows@>=0.\"5"
- exec "npm install \"express@>=1.0\""
+ exec "npm install \"vows@>=0.\"5", onerror
+ exec "npm install \"express@>=1.0\"", onerror
log "Need Ronn and Docco to generate documentation, installing ...", green
- exec "npm install \"ronn@>=0.3\""
- exec "npm install \"docco@>=0.3\""
+ exec "npm install \"ronn@>=0.3\"", onerror
+ exec "npm install \"docco@>=0.3\"", onerror
log "Need runtime dependencies, installing ...", green
fs.readFile "package.json", "utf8", (err, package)->
for name, version of JSON.parse(package).dependencies
- exec "npm install \"#{name}@#{version}\""
+ exec "npm install \"#{name}@#{version}\"", onerror
+
+
+## Building ##
+
+build = (callback)->
+ exec "rm -rf lib && coffee -c -o lib src", callback
+task "build", -> build onerror
+
+task "clean", "Remove temporary files and such", ->
+ exec "rm -rf clean html lib man1", onerror
+
+## Testing ##
-# Documentation
-# -------------
+runTests = (callback)->
+ log "Running test suite ...", green
+ exec "vows --spec", (err, stdout, stderr)->
+ log stdout, green
+ log stderr, red
+ callback err
+task "test", "Run all tests", -> runTests onerror
+
+
+
+## Documentation ##
# Markdown to HTML.
toHTML = (source, title, callback)->
target = "html/#{path.basename(source, ".md").toLowerCase()}.html"
fs.mkdir "html", 0777, ->
fs.readFile "doc/_layout.html", "utf8", (err, layout)->
- return callback(err) if err
+ onerror err
fs.readFile source, "utf8", (err, text)->
- return callback(err) if err
+ onerror err
log "Creating #{target} ...", green
exec "ronn --html #{source}", (err, stdout, stderr)->
- return callback(err) if err
+ onerror err
title ||= stdout.match(/<h1>(.*)<\/h1>/)[1]
body = stdout.replace(/<h1>.*<\/h1>/, "")
html = layout.replace("{{body}}", body).replace(/{{title}}/g, title)
@@ -56,77 +79,67 @@ toHTML = (source, title, callback)->
documentPages = (callback)->
toHTML "README.md", "Zombie.js", (err)->
- return callback(err) if err
+ onerror err
exec "mv html/readme.html html/index.html", (err)->
- return callback(err) if err
+ onerror err
toHTML "TODO.md", null, (err)->
- return callback(err) if err
- exec "cp -f doc/*.css html/", callback
+ onerror err
+ toHTML "CHANGELOG.md", null, (err)->
+ onerror err
+ exec "cp -f doc/*.css html/", callback
documentSource = (callback)->
log "Documenting source files ...", green
- exec "docco lib/**/*.coffee", (err)->
- return callback(err) if err
+ exec "docco src/**/*.coffee", (err)->
+ onerror err
log "Copying to html/source ...", green
exec "mkdir -p html && cp -rf docs/ html/source && rm -rf docs", callback
generateMan = (callback)->
log "Generating man file ...", green
fs.mkdir "man1", 0777, ->
exec "ronn --roff README.md", (err, stdout, stderr)->
- return callback(err) if err
+ onerror err
fs.writeFile "man1/zombie.1", stdout, "utf8", callback
generateDocs = (callback)->
log "Generating documentation ...", green
documentPages (err)->
- return callback(err) if err
+ onerror err
documentSource (err)->
- return callback(err) if err
+ onerror err
generateMan callback
-task "doc:pages", -> documentPages (err)-> throw err if err
-task "doc:source", -> documentSource (err)-> throw err if err
-task "doc:man", -> generateMan (err)-> throw err if err
-task "doc", "Generate documentation", -> generateDocs (err)-> throw err if err
-
-
-# Testing
-# -------
-
-runTests = (callback)->
- log "Running test suite ...", green
- exec "vows --spec", (err, stdout, stderr)->
- log stdout, green
- log stderr, red
- callback err
-task "test", "Run all tests", -> runTests (err)-> throw err if err
+task "doc:pages", -> documentPages onerror
+task "doc:source", -> documentSource onerror
+task "doc:man", -> generateMan onerror
+task "doc", "Generate documentation", -> generateDocs onerror
-# Publishing
-# ----------
+## Publishing ##
publishDocs = (callback)->
log "Publishing documentation ...", green
generateDocs (err)->
- return callback(err) if err
+ onerror err
log "Uploading documentation ...", green
exec "rsync -cr --del --progress html/ labnotes.org:/var/www/zombie/", callback
-task "doc:publish", -> publishDocs (err)-> throw err if err
+task "doc:publish", -> publishDocs onerror
task "publish", "Publish new version (Git, NPM, site)", ->
runTests (err)->
- throw err if err
+ onerror err
fs.readFile "package.json", "utf8", (err, package)->
version = JSON.parse(package).version
log "Tagging v#{version} ...", green
exec "git tag v#{version}", ->
exec "git push --tags origin master"
log "Publishing to NPM ...", green
- exec "rm -rf clean && git checkout-index -a -f --prefix clean/ && cp -rf man1 clean/", (err)->
- throw err if err
- exec "npm publish clean", (err)->
- throw err if err
+ exec "rm -rf clean && git checkout-index -a -f --prefix clean/ ; cp -rf man1 clean/", (err)->
+ onerror err
+ exec "coffee -c -o clean/lib clean/src", (err)->
+ onerror err
+ exec "npm publish clean", onerror
# Publish documentation
- publishDocs (err)-> throw err if err
+ publishDocs onerror
View
@@ -250,6 +250,8 @@ Zombie.js is written in
[Annotated Source Code](source/browser.html) for Zombie.js.
+[Changelog](changelog.html)
+
[Sizzle.js](https://github.com/jeresig/sizzle/wiki) documentation.
[Vows](http://vowsjs.org/) You don't have to, but I really recommend
View
@@ -1,6 +1,6 @@
{
"name": "zombie",
- "version": "0.6.4",
+ "version": "0.6.5",
"description": "Superfast headless full stack testing framework using node.js",
"homepage": "http://zombie.labnotes.org/",
"author": "Assaf Arkin <assaf@labnotes.org> (http://labnotes.org/)",
@@ -10,12 +10,11 @@
"headless",
"full-stack"
],
- "main": "./lib/zombie",
"directories": {
"doc": "./doc",
- "lib": "./lib"
+ "lib": "./lib",
+ "man": "./man1"
},
- "man": "./man1/zombie.1",
"scripts": {
"build": "cake",
"test": "vows"
@@ -32,6 +31,9 @@
"type": "git",
"url": "https://assaf@github.com/assaf/zombie.git"
},
+ "bugs": {
+ "url": "http://github.com/assaf/zombie/issues"
+ },
"licenses" : [
{ "type" : "MIT",
"url" : "http://github.com/assaf/zombie/raw/master/MIT-LICENSE"
View
@@ -1,4 +1,4 @@
-require.paths.push(__dirname + "/../lib")
+require.paths.push(__dirname + "/../src")
fs = require("fs")
express = require("express")
zombie = require("zombie")
@@ -1,5 +1,5 @@
# Constructor for a new Browser. Takes no arguments.
-exports.Browser = require("zombie/browser").Browser
+exports.Browser = require("./zombie/browser").Browser
# ### visit url, callback
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e05c3f6

Please sign in to comment.