 Neat = require '../../neat'
 
 {parallel} = Neat.require 'async'
-{ensure} = Neat.require 'utils/files'
+{ensurePath} = Neat.require 'utils/files'
 {writeFile} = require 'fs'
 {compile:coffee} = require 'coffee-script'
 {parser, uglify:pro} = require 'uglify-js'


saveToFile = (buffer, conf, callback) ->
  gen = (path, content) -> (callback) ->
    writeFile path, content, ->
      callback?()

  parallel (gen k,v for k,v of buffer), ->

createDirectory = (buffer, conf, callback) ->
  newBuffer = {}
  path = "#{conf.dir}/#{conf.directory}"
  ensurePath path, (err) ->
    for p,c of buffer
      newBuffer[p.replace conf.dir, path] = c

