Permalink
Browse files

Bug fixes, tightening up app structure

  • Loading branch information...
mikemurray committed Dec 11, 2011
1 parent 169f3df commit f679a1fb6943c8be94fdaa8b03226aa7805b90e3
Showing with 217 additions and 5 deletions.
  1. +32 −1 .gitignore
  2. +11 −0 Cakefile
  3. +6 −0 bin/sew
  4. +164 −0 lib/sew.js
  5. +4 −4 { → src}/sew.coffee
View
@@ -1 +1,32 @@
-node_modules/
+# Node
+b-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+*.swp
+
+pids
+logs
+results
+
+node_modules
+npm-debug.log
+
+# Vim
+.*.sw[a-z]
+*.un~
+Session.vim
+
+# OSX
+.DS_Store
+
+# Thumbnails
+._*
+
+# Files that might appear on external disk
+.Spotlight-V100
+.Trashes
View
@@ -0,0 +1,11 @@
+{spawn} = require 'child_process'
+{log} = require 'util'
+
+build = (callback) ->
+ c = spawn 'coffee', ['-c', '-o', 'lib', 'src']
+ c.stdout.on 'data', (data) -> log data.toString()
+ c.stderr.on 'data', (data) -> log data.toString()
+ c.on 'exit', (status) -> callback?() if status is 0
+
+task 'build', 'Build src/ to lib/', ->
+ build()
View
@@ -0,0 +1,6 @@
+#!/usr/bin/env node
+
+var path = require('path');
+var lib = path.join(path.dirname(__filename), '../lib/sew');
+
+var wkr = require(lib);
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -14,9 +14,9 @@ class Worker
options:
public: './public'
jsPath: './app'
- cssPath: './styles/style.less'
+ cssPath: './app/css/style.less'
outputJs: './public/js/scripts.js'
- outputCss: '.public/css/styles.css'
+ outputCss: './public/css/styles.css'
constructor: ->
@readConfig()
@@ -42,7 +42,7 @@ class Worker
watch: ->
@compile()
- @walk @options.publicDir, (file) =>
+ @walk @options.jsPath, (file) =>
fs.watchFile file, (curr, prev) =>
if curr and (curr.nlink is 0 or +curr.mtime isnt +prev.mtime)
switch fpath.extname file
@@ -52,7 +52,7 @@ class Worker
serve: ->
@watch()
@app.use strata.commonLogger
- @app.use strata.static, @options.publicDir, ['index.html', 'index.htm']
+ @app.use strata.static, @options.public, ['index.html', 'index.htm']
strata.run(@app)
# Compilers

0 comments on commit f679a1f

Please sign in to comment.