Skip to content

Commit 1ae0948

Browse files
committed
first commit
0 parents  commit 1ae0948

File tree

683 files changed

+61231
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

683 files changed

+61231
-0
lines changed

.braids

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
lib/coffee/lib/coffee-script:
3+
squashed: true
4+
branch: master
5+
url: http://github.com/jashkenas/coffee-script.git
6+
type: git
7+
revision: 485346f0e57bf3e56bc715ee81c88145e1590b6c
8+
remote: braid/lib/coffee/lib/coffee-script
9+
lib/socket.io:
10+
squashed: true
11+
branch: master
12+
url: http://github.com/LearnBoost/Socket.IO-node.git
13+
type: git
14+
revision: fbce6379a5065b5c5b95a3eaeabf57a555557548
15+
remote: braid/lib/socket.io
16+
lib/socket.io/lib/vendor/js-oo:
17+
squashed: true
18+
branch: master
19+
url: git://github.com/visionmedia/js-oo.git
20+
type: git
21+
revision: 1f94bd897994a952114cb1f280c1949d5e6a0648
22+
remote: braid/lib/socket.io/lib/vendor/js-oo
23+
lib/express/lib/support/ext:
24+
squashed: true
25+
branch: master
26+
url: git://github.com/visionmedia/ext.js.git
27+
type: git
28+
revision: 282c20ccb6a6f1ade55a98ce24bf8b68a508b0f6
29+
remote: braid/lib/express/lib/support/ext
30+
lib/nodeunit:
31+
squashed: true
32+
branch: master
33+
url: http://github.com/caolan/nodeunit.git
34+
type: git
35+
revision: 3437a428ef736fbcdae66c92a7a3bb0806f1a2af
36+
remote: braid/lib/nodeunit
37+
lib/express/lib/support/class:
38+
squashed: true
39+
branch: master
40+
url: git://github.com/visionmedia/class.js.git
41+
type: git
42+
revision: 6fa0d584c18bfab7aa707db226245f9eff85d1b6
43+
remote: braid/lib/express/lib/support/class
44+
lib/express/lib/support/multipart:
45+
squashed: true
46+
branch: master
47+
url: git://github.com/isaacs/multipart-js.git
48+
type: git
49+
revision: 0b77a68582a9a533c4c57bd01210553f6d881868
50+
remote: braid/lib/express/lib/support/multipart
51+
lib/express:
52+
squashed: true
53+
branch: master
54+
url: git://github.com/visionmedia/express.git
55+
type: git
56+
revision: d579d62eb61f10234fdfe69dc5c2f6d7fa67bfd1
57+
remote: braid/lib/express
58+
lib/express/lib/support/haml:
59+
squashed: true
60+
url: git://github.com/visionmedia/haml.js.git
61+
branch: master
62+
type: git
63+
revision: c383b48bf72438d726c0af13c983d48c7d32a158
64+
remote: braid/lib/express/lib/support/haml
65+
public/javascripts/socket.io:
66+
squashed: true
67+
branch: master
68+
url: http://github.com/LearnBoost/Socket.IO.git
69+
type: git
70+
revision: 8a34dc75986c3c28da1dd21448e770dc5b54d44e
71+
remote: braid/public/javascripts/socket.io
72+
lib/express/lib/support/sass:
73+
squashed: true
74+
branch: master
75+
url: git://github.com/visionmedia/sass.js.git
76+
type: git
77+
revision: fac9a896b361e32c02000bc7f7b92d4887332518
78+
remote: braid/lib/express/lib/support/sass
79+
public/javascripts/socket.io/lib/vendor/web-socket-js:
80+
squashed: true
81+
branch: master
82+
url: git://github.com/gimite/web-socket-js.git
83+
type: git
84+
revision: e5c19418fd4e70f28d36c694e6e45e750abe6e76
85+
remote: braid/public/javascripts/socket.io/lib/vendor/web-socket-js

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Node.js Knockout!!
2+
3+
Node.js Knockout is a 48 hour hackathon, like [Rails Rumble](http://wwww.railsrumble.com).
4+
5+
Follow [@node_knockout](http://www.twitter.com/node_knockout) for updates.
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
raw
2+
presentation
3+
test.coffee
4+
parser.output
5+
test/fixtures/underscore
6+
examples/beautiful_code/parse.coffee
7+
*.gem

lib/coffee/lib/coffee-script/Cakefile

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
fs: require 'fs'
2+
{helpers}: require('./lib/helpers')
3+
CoffeeScript: require './lib/coffee-script'
4+
{spawn, exec}: require('child_process')
5+
6+
# Run a CoffeeScript through our node/coffee interpreter.
7+
run: (args) ->
8+
proc: spawn 'bin/coffee', args
9+
proc.stderr.addListener 'data', (buffer) -> puts buffer.toString()
10+
proc.addListener 'exit', (status) -> process.exit(1) if status != 0
11+
12+
option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`'
13+
14+
task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options) ->
15+
base: options.prefix or '/usr/local'
16+
lib: "$base/lib/coffee-script"
17+
bin: "$base/bin"
18+
exec([
19+
"mkdir -p $lib $bin"
20+
"cp -rf bin lib LICENSE README package.json src vendor $lib"
21+
"ln -sf $lib/bin/coffee $base/bin/coffee"
22+
"ln -sf $lib/bin/cake $base/bin/cake"
23+
"mkdir -p ~/.node_libraries"
24+
"ln -sf $lib/lib ~/.node_libraries/coffee-script"
25+
].join(' && '), (err, stdout, stderr) ->
26+
if err then print stderr
27+
)
28+
29+
30+
task 'build', 'build the CoffeeScript language from source', ->
31+
files: fs.readdirSync 'src'
32+
files: 'src/' + file for file in files when file.match(/\.coffee$/)
33+
run ['-c', '-o', 'lib'].concat(files)
34+
35+
36+
task 'build:full', 'rebuild the source twice, and run the tests', ->
37+
exec 'bin/cake build && bin/cake build && bin/cake test', (err, stdout, stderr) ->
38+
print stdout if stdout
39+
print stderr if stderr
40+
throw err if err
41+
42+
43+
task 'build:parser', 'rebuild the Jison parser (run build first)', ->
44+
require.paths.unshift 'vendor/jison/lib'
45+
parser: require('./lib/grammar').parser
46+
js: parser.generate()
47+
parser_path: 'lib/parser.js'
48+
fs.writeFile parser_path, js
49+
50+
51+
task 'build:ultraviolet', 'build and install the Ultraviolet syntax highlighter', ->
52+
exec 'plist2syntax ../coffee-script-tmbundle/Syntaxes/CoffeeScript.tmLanguage', (err) ->
53+
throw err if err
54+
exec 'sudo mv coffeescript.yaml /usr/local/lib/ruby/gems/1.8/gems/ultraviolet-0.10.2/syntax/coffeescript.syntax'
55+
56+
57+
task 'build:browser', 'rebuild the merged script for inclusion in the browser', ->
58+
exec 'rake browser', (err) ->
59+
throw err if err
60+
61+
62+
task 'doc:site', 'watch and continually rebuild the documentation for the website', ->
63+
exec 'rake doc'
64+
65+
66+
task 'doc:source', 'rebuild the internal documentation', ->
67+
exec 'docco src/*.coffee && cp -rf docs documentation && rm -r docs', (err) ->
68+
throw err if err
69+
70+
71+
task 'doc:underscore', 'rebuild the Underscore.coffee documentation page', ->
72+
exec 'docco examples/underscore.coffee && cp -rf docs documentation && rm -r docs', (err) ->
73+
throw err if err
74+
75+
76+
task 'test', 'run the CoffeeScript language test suite', ->
77+
helpers.extend global, require 'assert'
78+
passed_tests: failed_tests: 0
79+
start_time: new Date()
80+
original_ok: ok
81+
helpers.extend global, {
82+
ok: (args...) -> passed_tests += 1; original_ok(args...)
83+
CoffeeScript: CoffeeScript
84+
}
85+
red: '\033[0;31m'
86+
green: '\033[0;32m'
87+
reset: '\033[0m'
88+
process.addListener 'exit', ->
89+
time: ((new Date() - start_time) / 1000).toFixed(2)
90+
message: "passed $passed_tests tests in $time seconds$reset"
91+
puts(if failed_tests then "${red}failed $failed_tests and $message" else "$green$message")
92+
fs.readdir 'test', (err, files) ->
93+
files.forEach (file) ->
94+
return unless file.match(/\.coffee$/i)
95+
source: path.join 'test', file
96+
fs.readFile source, (err, code) ->
97+
try
98+
CoffeeScript.run code.toString(), {source: source}
99+
catch err
100+
failed_tests += 1
101+
puts "${red}failed:${reset} $source"
102+
puts err.stack

lib/coffee/lib/coffee-script/LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2010 Jeremy Ashkenas
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the "Software"), to deal in the Software without
6+
restriction, including without limitation the rights to use,
7+
copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.

lib/coffee/lib/coffee-script/README

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
=
2+
{
3+
} } {
4+
{ { } }
5+
} }{ {
6+
{ }{ } } _____ __ __
7+
( }{ }{ { ) / ____| / _|/ _|
8+
.- { { } { }} -. | | ___ | |_| |_ ___ ___
9+
( ( } { } { } } ) | | / _ \| _| _/ _ \/ _ \
10+
|`-..________ ..-'| | |___| (_) | | | || __/ __/
11+
| | \_____\___/|_| |_| \___|\___|
12+
| ;--.
13+
| (__ \ _____ _ _
14+
| | ) ) / ____| (_) | |
15+
| |/ / | (___ ___ _ __ _ _ __ | |_
16+
| ( / \___ \ / __| '__| | '_ \| __|
17+
| |/ ____) | (__| | | | |_) | |_
18+
| | |_____/ \___|_| |_| .__/ \__|
19+
`-.._________..-' | |
20+
|_|
21+
22+
23+
CoffeeScript is a little language that compiles into JavaScript.
24+
25+
Install Node.js, and then the CoffeeScript compiler:
26+
sudo bin/cake install
27+
28+
Compile a script:
29+
coffee /path/to/script.coffee
30+
31+
For documentation, usage, and examples, see:
32+
http://coffeescript.org/
33+
34+
To suggest a feature, report a bug, or general discussion:
35+
http://github.com/jashkenas/coffee-script/issues/
36+
37+
If you'd like to chat, drop by #coffeescript on Freenode IRC,
38+
or on webchat.freenode.net.
39+
40+
The source repository:
41+
git://github.com/jashkenas/coffee-script.git
42+
43+
44+
Contributors:
45+
46+
Stan Angeloff (StanAngeloff)
47+
Jeremy Ashkenas (jashkenas)
48+
Zach Carter (zaach)
49+
Tim Cuthbertson (gfxmonk)
50+
Mathieu D'Amours (matehat)
51+
Chris Hoffman (cehoffman)
52+
Jason Huggins (hugs)
53+
Timothy Jones (Tesco)
54+
Chris Lloyd (chrislloyd)
55+
Matt Lyon (mattly)
56+
Jeff Olson (olsonjeffery)
57+
Nathan Ostgard (noonat)
58+
Samuel Reis (grgh)
59+
Tom Robinson (tlrobinson)
60+
Tim Smart (Tim-Smart)
61+
Dr. Nic Williams (drnic)
62+

lib/coffee/lib/coffee-script/Rakefile

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
require 'erb'
2+
require 'fileutils'
3+
require 'rake/testtask'
4+
require 'rubygems'
5+
require 'yui/compressor'
6+
7+
desc "Build the documentation page"
8+
task :doc do
9+
source = 'documentation/index.html.erb'
10+
child = fork { exec "bin/coffee -c documentation/coffee/*.coffee -o documentation/js -w" }
11+
at_exit { Process.kill("INT", child) }
12+
Signal.trap("INT") { exit }
13+
loop do
14+
mtime = File.stat(source).mtime
15+
if !@mtime || mtime > @mtime
16+
rendered = ERB.new(File.read(source)).result(binding)
17+
File.open('index.html', 'w+') {|f| f.write(rendered) }
18+
end
19+
@mtime = mtime
20+
sleep 1
21+
end
22+
end
23+
24+
desc "Build the single concatenated and minified script for the browser"
25+
task :browser do
26+
sources = %w(helpers.js rewriter.js lexer.js parser.js scope.js nodes.js coffee-script.js)
27+
code = sources.map {|s| File.read('lib/' + s) }.join('')
28+
code = YUI::JavaScriptCompressor.new.compress(code)
29+
File.open('extras/coffee-script.js', 'w+') {|f| f.write(code) }
30+
end
31+

lib/coffee/lib/coffee-script/bin/cake

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env node
2+
3+
var path = require('path');
4+
var fs = require('fs');
5+
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
6+
7+
require(lib + '/helpers').helpers.extend(global, require('sys'));
8+
require(lib + '/cake').run();
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env node
2+
3+
var path = require('path');
4+
var fs = require('fs');
5+
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
6+
7+
require(lib + '/helpers').helpers.extend(global, require('sys'));
8+
require(lib + '/command').run();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
launch() if ignition is on
2+
3+
volume: 10 if band isnt spinal_tap
4+
5+
let_the_wild_rumpus_begin() unless answer is no
6+
7+
if car.speed < speed_limit then accelerate()
8+
9+
print "My name is " + @name
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Eat lunch.
2+
lunch: eat food for food in ['toast', 'cheese', 'wine']
3+
4+
# Naive collision detection.
5+
for roid in asteroids
6+
for roid2 in asteroids when roid isnt roid2
7+
roid.explode() if roid.overlaps roid2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
greeting: "Hello CoffeeScript"
2+
difficulty: 0.5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
url: "documentation/coffee/binding.coffee"
2+
3+
get_source: jQuery.get <- jQuery, url
4+
5+
get_source (response) -> alert response
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
task 'test', 'run each of the unit tests', ->
2+
for test in test_files
3+
fs.readFile test, (err, code) -> eval coffee.compile code

0 commit comments

Comments
 (0)