Skip to content

Commit

Permalink
js code convention
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolaus Graf committed May 18, 2011
1 parent 9369e2d commit 634c125
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions lib/compilers/base.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions lib/compilers/stylus.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/compilers/base.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class exports.Compiler
# can be overwritten to change behavior on file changed events
# by default waits 20ms for file events then calls compile with all changed files
fileChanged: (file) ->
@_changed_files ||= []
@_changed_files.push(file)
clearTimeout(@_timeout)
@_timeout = setTimeout( =>
_.bind(@compile, @, @_changed_files)()
@_changed_files = null
@changedFiles ||= []
@changedFiles.push(file)
clearTimeout(@timeout)
@timeout = setTimeout( =>
_.bind(@compile, @, @changedFiles)()
@changedFiles = null
, 20)
6 changes: 3 additions & 3 deletions src/compilers/stylus.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ class exports.StylusCompiler extends Compiler
[/\.styl$/]

compile: (files) ->
main_file_path = path.join(@options.brunchPath, 'src/app/styles/main.styl')
fs.readFile(main_file_path, 'utf8', (err, data) =>
mainFilePath = path.join(@options.brunchPath, 'src/app/styles/main.styl')
fs.readFile(mainFilePath, 'utf8', (err, data) =>
if err?
helpers.log colors.lred('stylus err: ' + err)
else
compiler = stylus(data)
.set('filename', main_file_path)
.set('filename', mainFilePath)
.set('compress', true)
.include(path.join(@options.brunchPath, 'src'))

Expand Down

0 comments on commit 634c125

Please sign in to comment.