Merge branch 'restructure' of https://github.com/gfxmonk/coffee-script into restructuring

Conflicts:
	Cakefile
This commit is contained in:
Michael Ficarra 2011-08-05 17:47:54 -04:00
commit c222da9dd6
32 changed files with 16 additions and 16 deletions

View File

@ -1,6 +1,6 @@
fs = require 'fs'
path = require 'path'
{extend} = require './lib/helpers'
{extend} = require './lib/coffee-script/helpers'
CoffeeScript = require './lib/coffee-script'
{spawn, exec} = require 'child_process'
@ -22,10 +22,11 @@ header = """
"""
sources = [
'src/coffee-script.coffee', 'src/grammar.coffee'
'src/helpers.coffee', 'src/lexer.coffee', 'src/nodes.coffee'
'src/rewriter.coffee', 'src/scope.coffee'
]
'coffee-script.coffee', 'grammar.coffee'
'helpers.coffee', 'lexer.coffee', 'nodes.coffee'
'rewriter.coffee', 'scope.coffee'
].map (filename) ->
'src/coffee-script/' + filename
# Run a CoffeeScript through our node/coffee interpreter.
run = (args, cb) ->
@ -55,7 +56,7 @@ task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options)
"ln -sfn #{lib}/bin/coffee #{bin}/coffee"
"ln -sfn #{lib}/bin/cake #{bin}/cake"
"mkdir -p ~/.node_libraries"
"ln -sfn #{lib}/lib #{node}"
"ln -sfn #{lib}/lib/coffee-script #{node}"
].join(' && '), (err, stdout, stderr) ->
if err then console.log stderr.trim() else log 'done', green
)
@ -63,8 +64,7 @@ task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options)
task 'build', 'build the CoffeeScript language from source', build = (cb) ->
files = fs.readdirSync 'src'
files = ('src/' + file for file in files when file.match(/\.coffee$/))
run ['-c', '-o', 'lib'].concat(files), cb
run ['-c', '-o', 'lib', 'src']
task 'build:full', 'rebuild the source twice, and run the tests', ->
@ -92,7 +92,7 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser',
code += """
require['./#{name}'] = new function() {
var exports = this;
#{fs.readFileSync "lib/#{name}.js"}
#{fs.readFileSync "lib/coffee-script/#{name}.js"}
};
"""
code = """
@ -116,7 +116,7 @@ task 'doc:site', 'watch and continually rebuild the documentation for the websit
task 'doc:source', 'rebuild the internal documentation', ->
exec 'docco src/*.coffee && cp -rf docs documentation && rm -r docs', (err) ->
exec 'docco src/coffee-script/*.coffee && cp -rf docs documentation && rm -r docs', (err) ->
throw err if err
@ -125,7 +125,7 @@ task 'doc:underscore', 'rebuild the Underscore.coffee documentation page', ->
throw err if err
task 'bench', 'quick benchmark of compilation time', ->
{Rewriter} = require './lib/rewriter'
{Rewriter} = require './lib/coffee-script/rewriter'
co = sources.map((name) -> fs.readFileSync name).join '\n'
fmt = (ms) -> " #{bold}#{ " #{ms}".slice -4 }#{reset} ms"
total = 0

View File

@ -4,4 +4,4 @@ var path = require('path');
var fs = require('fs');
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
require(lib + '/cake').run();
require(lib + '/coffee-script/cake').run();

View File

@ -4,4 +4,4 @@ var path = require('path');
var fs = require('fs');
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
require(lib + '/command').run();
require(lib + '/coffee-script/command').run();

0
lib/cake.js → lib/coffee-script/cake.js Executable file → Normal file
View File

View File

0
lib/optparse.js → lib/coffee-script/optparse.js Executable file → Normal file
View File

View File

@ -12,9 +12,9 @@
"node": ">=0.2.5"
},
"directories" : {
"lib" : "./lib"
"lib" : "./lib/coffee-script"
},
"main" : "./lib/coffee-script",
"main" : "./lib/coffee-script/coffee-script",
"bin": {
"coffee": "./bin/coffee",
"cake": "./bin/cake"

View File

@ -5,7 +5,7 @@
# Ensure that the OptionParser handles arguments correctly.
return unless require?
{OptionParser} = require './../lib/optparse'
{OptionParser} = require './../lib/coffee-script/optparse'
opt = new OptionParser [
['-r', '--required [DIR]', 'desc required']