Skip to content

Commit

Permalink
v0.1.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricemach committed Jan 5, 2011
1 parent ec990ae commit 5ccf1cb
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 30 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,13 @@
**v0.1.4** (2010-01-05):

- Updated to CoffeeScript 1.0.0 and node 0.2.6/0.3.3.
- Soda tests by Nicholas Kinsey.
- `broadcast` passing along optional `except` param to socket.io.
- Empty app files now start a default "blank" app, serving files at /public.
- `zappa -n/--hostname` to listen on a specific hostname or IP.
- Made defs available to postrenders' scope.
- Bug fixes.

**v0.1.3** (2010-11-13):

- Updated to CoffeeScript 0.9.5 and node 0.2.5/0.3.1.
Expand Down
2 changes: 1 addition & 1 deletion Cakefile
Expand Up @@ -16,4 +16,4 @@ task 'test', ->
puts 'stderr: ' + data

tests.on 'exit', (code) ->
puts 'tests exited with code ' + code
puts 'tests exited with code ' + code
8 changes: 2 additions & 6 deletions README.md
Expand Up @@ -298,7 +298,7 @@ If there's a `./public` dir on the same level as your app's main file, static fi

## Testing

At the moment there are no unit tests or specs. However the tests currently provided are "headed" tests which run in the browser via "remote control". Pretty radical.
At the moment there are no unit tests or specs. However the tests currently provided are "headed" tests which run in the browser via "remote control".

To run the headed, awesome, remote-control, in-browser tests you need Firefox 3.

Expand All @@ -312,13 +312,9 @@ Before the tests can be run, the [Selenium RC](http://seleniumhq.org/projects/re

You can get the Selenium RC from http://selenium.googlecode.com/files/selenium-remote-control-1.0.3.zip.

Once it's running, simply launch the automated tests...
Once it's running, simply launch the automated tests:

cake test

What happens next is mind-blowingly amazing; but I'll leave that as a special surprise for the brave and fearless testers.

P.S: The tests are asynchronous ... *drool*

## Whew!

Expand Down
30 changes: 18 additions & 12 deletions bin/zappa.coffee
Expand Up @@ -5,16 +5,16 @@ coffee = require 'coffee-script'
fs = require 'fs'
path = require 'path'
puts = console.log
inspect = require('util').inspect
spawn = require('child_process').spawn
OptionParser = require('coffee-script/optparse').OptionParser
{inspect} = require 'util'
{spawn} = require 'child_process'
{OptionParser} = require 'coffee-script/optparse'
child = null
file = null
watching = []

# On coffee-script@0.9.6, argv looks like [filename],
# On coffee-script@1.0.0, argv looks like ["node", "path/to/coffee", filename]
if process.argv[0] is 'node' and process.argv.length >= 3
if process.argv[0] is 'node' and process.argv.length >= 2
argv = process.argv[2..]
else
argv = process.argv[0..]
Expand All @@ -33,14 +33,18 @@ switches = [
['-w', '--watch', 'Keeps watching the file and restarts the app when it changes.']
]

compile = (coffee_path) ->
compile = (coffee_path, callback) ->
fs.readFile coffee_path, (err, data) ->
js = coffee.compile String(data), bare: yes
js = "require('zappa').run(function(){#{js}});"
js_path = path.basename(coffee_path, path.extname(coffee_path)) + '.js'
dir = path.dirname coffee_path
js_path = path.join dir, js_path
fs.writeFile js_path, js
if err then callback(err)
else
js = coffee.compile String(data), bare: yes
js = "require('zappa').run(function(){#{js}});"
js_path = path.basename(coffee_path, path.extname(coffee_path)) + '.js'
dir = path.dirname coffee_path
js_path = path.join dir, js_path
fs.writeFile js_path, js, (err) ->
if err then callback(err)
else callback()

remove_watch_option = ->
i = argv.indexOf('-w')
Expand Down Expand Up @@ -89,7 +93,9 @@ else
process.exit -1

if options.compile
compile file
compile file, (err) ->
if err then puts err; process.exit -1
else process.exit()
else
if options.watch
remove_watch_option()
Expand Down
7 changes: 3 additions & 4 deletions lib/zappa.coffee
Expand Up @@ -2,7 +2,7 @@ zappa = exports
express = require 'express'
fs = require 'fs'
puts = console.log
inspect = require('sys').inspect
{inspect} = require 'sys'
coffee = null
jquery = null
io = null
Expand All @@ -22,11 +22,10 @@ class Zappa
process: process
module: module

@ensure_app 'default' unless @current_app?

for name in 'get|post|put|del|route|at|msg|client|using|def|helper|postrender|layout|view|style'.split '|'
do (name) =>
@locals[name] = =>
@ensure_app 'default' unless @current_app?
@current_app[name].apply @current_app, arguments

app: (name) ->
Expand Down Expand Up @@ -431,6 +430,6 @@ publish_api = (from, to, methods) ->

z = new Zappa()

zappa.version = '0.1.3'
zappa.version = '0.1.4'
zappa.run = -> z.run.apply z, arguments
zappa.run_file = -> z.run_file.apply z, arguments
16 changes: 9 additions & 7 deletions package.json
@@ -1,22 +1,24 @@
{
"name": "zappa",
"description": "Razor-sharp DSL for modern web apps.",
"version": "0.1.3",
"description": "Web development, cut-the-crap style.",
"version": "0.1.4",
"author": "Maurice Machado <maurice@bitbending.com>",
"contributors": [
{"name": "Maurice Machado", "email": "maurice@bitbending.com"},
{"name": "Nicholas Kinsey", "email": "nicholas.kinsey@feistystudios.com"},
{"name": "Jae Kwon", "email": "jae@flywheelnetworks.com"},
{"name": "Vladimir Dronnikov", "email": "dronnikov@gmail.com"},
{"name": "Isaac Wolkerstorfer", "email": "agnoster@gmail.com"}
],
"dependencies": {
"express": "1.0.0",
"coffeekup": ">= 0.2.1",
"coffee-script": ">= 0.9.5",
"socket.io": ">= 0.6.1",
"express": ">= 1.0.1",
"coffeekup": ">= 0.2.2",
"coffee-script": ">= 1.0.0",
"socket.io": ">= 0.6.3",
"jquery": ">= 1.4.3"
},
"keywords": ["framework", "websockets", "coffeescript"],
"bin": { "zappa": "./bin/zappa.coffee" },
"directories": { "lib": "./lib" },
"engines": { "node": ">= 0.2.5" }
"engines": { "node": ">= 0.2.6" }
}

0 comments on commit 5ccf1cb

Please sign in to comment.