Skip to content

Commit

Permalink
Added cake vendor and updated jquery (1.6.4) and sammy (0.7.0). Clo…
Browse files Browse the repository at this point in the history
…ses pull #77.
  • Loading branch information
mauricemach committed Sep 15, 2011
1 parent c9be150 commit b718272
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -5,4 +5,5 @@ lib/*.js
benchmarks/out/*.dat
benchmarks/out/*.out
tests/*.js
_site
_site
vendor
6 changes: 6 additions & 0 deletions Cakefile
Expand Up @@ -12,6 +12,12 @@ task 'bench', ->

task 'docs', ->
run 'docco src/*.coffee'

task 'vendor', ->
run 'mkdir -p vendor && cd vendor && curl -OL http://code.jquery.com/jquery-1.6.4.min.js', ->
run 'cd vendor && curl -OL http://raw.github.com/quirkey/sammy/v0.7.0/lib/min/sammy-0.7.0.min.js', ->
run 'head -n 1 vendor/jquery*', ->
run 'head -n 3 vendor/sammy*'

run = (args...) ->
for a in args
Expand Down
4 changes: 2 additions & 2 deletions docs/reference.md
Expand Up @@ -479,11 +479,11 @@ Serves `/zappa/zappa.js`, required to use the zappa client API. Automatically en

### serve jquery

Serves `/zappa/jquery.js` (minified jQuery 1.6.2 from npm).
Serves `/zappa/jquery.js` (just standard, minified jQuery).

### serve sammy

Serves `/zappa/sammy.js` (minified Sammy 0.6.3).
Serves `/zappa/sammy.js` (just standard, minified Sammy).

### minify

Expand Down
4 changes: 2 additions & 2 deletions docs/zappa.html
Expand Up @@ -10,8 +10,8 @@
<span class="nv">express = </span><span class="nx">require</span> <span class="s1">&#39;express&#39;</span>
<span class="nv">socketio = </span><span class="nx">require</span> <span class="s1">&#39;socket.io&#39;</span>
<span class="nv">jsdom = </span><span class="nx">require</span> <span class="s1">&#39;jsdom&#39;</span>
<span class="nv">jquery = </span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/../node_modules/jquery/dist/node-jquery.min.js&#39;</span><span class="p">).</span><span class="nx">toString</span><span class="p">()</span>
<span class="nv">sammy = </span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/../vendor/sammy-latest.min.js&#39;</span><span class="p">).</span><span class="nx">toString</span><span class="p">()</span>
<span class="nv">jquery = </span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/../vendor/jquery-1.6.4.min.js&#39;</span><span class="p">).</span><span class="nx">toString</span><span class="p">()</span>
<span class="nv">sammy = </span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/../vendor/sammy-0.7.0.min.js&#39;</span><span class="p">).</span><span class="nx">toString</span><span class="p">()</span>
<span class="nv">uglify = </span><span class="nx">require</span> <span class="s1">&#39;uglify-js&#39;</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>CoffeeScript-generated JavaScript may contain anyone of these; when we "rewrite"
a function (see below) though, it loses access to its parent scope, and consequently to
any helpers it might need. So we need to reintroduce these helpers manually inside any
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -10,7 +10,6 @@
"express": "2.4.6",
"socket.io": "0.8.4",
"jsdom": "0.2.4",
"jquery": "1.6.2",
"coffeekup": "0.3.0",
"node-uuid": "1.2.0",
"uglify-js": "1.0.7"
Expand Down
4 changes: 2 additions & 2 deletions src/zappa.coffee
Expand Up @@ -12,8 +12,8 @@ uuid = require 'node-uuid'
express = require 'express'
socketio = require 'socket.io'
jsdom = require 'jsdom'
jquery = fs.readFileSync(__dirname + '/../node_modules/jquery/dist/node-jquery.min.js').toString()
sammy = fs.readFileSync(__dirname + '/../vendor/sammy-latest.min.js').toString()
jquery = fs.readFileSync(__dirname + '/../vendor/jquery-1.6.4.min.js').toString()
sammy = fs.readFileSync(__dirname + '/../vendor/sammy-0.7.0.min.js').toString()
uglify = require 'uglify-js'

# CoffeeScript-generated JavaScript may contain anyone of these; when we "rewrite"
Expand Down
4 changes: 2 additions & 2 deletions tests/assets.coffee
Expand Up @@ -99,7 +99,7 @@ port = 15200
c = t.client(zapp.app)
c.get '/zappa/jquery.js', (err, res) ->
t.equal 'content-type', res.headers['content-type'], 'application/javascript'
t.equal 'length', res.headers['content-length'], '92334'
t.equal 'length', res.headers['content-length'], '91669'

sammy: (t) ->
t.expect 'content-type', 'length'
Expand All @@ -111,7 +111,7 @@ port = 15200
c = t.client(zapp.app)
c.get '/zappa/sammy.js', (err, res) ->
t.equal 'content-type', res.headers['content-type'], 'application/javascript'
t.equal 'length', res.headers['content-length'], '16854'
t.equal 'length', res.headers['content-length'], '18059'

zappa: (t) ->
t.expect 'content-type', 'length'
Expand Down
5 changes: 0 additions & 5 deletions vendor/sammy-latest.min.js

This file was deleted.

0 comments on commit b718272

Please sign in to comment.