tasks/joosy.coffee in joosy-1.2.0.alpha.32 vs tasks/joosy.coffee in joosy-1.2.0.alpha.33
- old
+ new
@@ -24,12 +24,12 @@
stylus.define '$environment', environment
stylus.define '$config', grunt.config.get('joosy.config') || {}
stylus.use require('nib')()
assets = new Mincer.Environment(process.cwd())
- assets.appendPath 'source'
- assets.appendPath 'stylesheets'
+ assets.appendPath 'source/javascript'
+ assets.appendPath 'source/stylesheets'
assets.appendPath 'vendor'
assets.appendPath 'components'
assets.appendPath 'node_modules/joosy/src'
assets
@@ -50,11 +50,11 @@
grunt.file.write entry.dest, asset.toString()
callbacks.compiled? asset, entry.dest
callbacks.success?() if deepness == 0
haml:
- compile: (file, partials='./', environment='development') ->
+ compile: (file, partials='source/haml', environment='development') ->
HAMLC = require 'haml-coffee'
HAMLC.compile(grunt.file.read file)(
environment: environment
config: grunt.config.get('joosy.config') || {}
@@ -94,21 +94,23 @@
serveHAML: (server, map) ->
return unless map?
for _, entry of map
- paths = entry.path
- paths = [paths] unless Object.isArray(paths)
+ do (_, entry) ->
+ paths = entry.path
+ paths = [paths] unless Object.isArray(paths)
- for path in paths
- server.use path, (req, res, next) ->
- if req.originalUrl == path
- res.end grunt.joosy.haml.compile("source/"+entry.src, entry.partials)
- console.log "Served #{path} (#{entry.src})"
- else
- next()
- console.log "=> Serving #{entry.src} from #{paths.join(', ')}"
+ for path in paths
+ do (path) ->
+ server.use path, (req, res, next) ->
+ if req.originalUrl == path
+ res.end grunt.joosy.haml.compile("source/haml/"+entry.src, entry.partials)
+ console.log "Served #{path} (#{entry.src})"
+ else
+ next()
+ console.log "=> Serving #{entry.src} from #{paths.join(', ')}"
serveStatic: (server, compress=false) ->
Gzippo = require 'gzippo'
unless compress
@@ -163,7 +165,7 @@
compiled: (asset, dest) -> grunt.log.ok "Compiled #{dest}"
success: complete
grunt.registerTask 'joosy:haml', ->
for _, entry of grunt.joosy.helpers.list(@, 'joosy.haml', @args[0])
- grunt.file.write entry.dest, grunt.joosy.haml.compile("source/#{entry.src}", entry.partials, 'production')
+ grunt.file.write entry.dest, grunt.joosy.haml.compile("source/haml/#{entry.src}", entry.partials, 'production')
grunt.log.ok "Compiled #{entry.dest}"
\ No newline at end of file