assets-include
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -0,1 +1,6 @@ | ||
0.6.1 / 2012-08-09 | ||
================== | ||
* Fixed getting inline assets with cache boosters and asset hosts. | ||
0.6.0 / 2012-08-09 | ||
@@ -48,2 +53,2 @@ ================== | ||
* First version - expanding unbundled, bundled, and inline assets based on YAML config file. | ||
* First version - expanding unbundled, bundled, and inline assets based on YAML config file. |
@@ -66,3 +66,3 @@ var AssetsExpander = require('assets-expander'), | ||
if (this.options.bundled && this.cacheInfo) { | ||
var pathWithStamp = this._assetPathWithStamp(this._bundledPath(bundleInfo), bundleInfo); | ||
var pathWithStamp = this._assetPathWithStamp(this._bundledPath(bundleInfo), bundleInfo, true); | ||
data = fs.readFileSync(path.join(this.options.root, pathWithStamp), 'utf-8'); | ||
@@ -81,4 +81,4 @@ } else { | ||
_assetPathWithStamp: function(assetPath, bundleInfo) { | ||
var hostPrefix = this.hostsIterator ? '//' + this.hostsIterator.next() : ''; | ||
_assetPathWithStamp: function(assetPath, bundleInfo, skipHosts) { | ||
var hostPrefix = this.hostsIterator && !skipHosts ? '//' + this.hostsIterator.next() : ''; | ||
var relativePath = assetPath.replace(this.options.root, ''); | ||
@@ -85,0 +85,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "Include assets into your views with ease (assets-packager compatible).", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "" |
@@ -277,4 +277,10 @@ var vows = require('vows'), | ||
} | ||
}, { bundled: true, assetHosts: 'goalsmashers.com' }) | ||
}, { bundled: true, assetHosts: 'goalsmashers.com' }), | ||
'in bundled (prod) mode with cache boosters and asset hosts': includeContext({ | ||
'should give a bundled script tag': function(include) { | ||
var asFragment = include.inline('javascripts/all.js'); | ||
assert.equal("<script>123-booster</script>", asFragment); | ||
} | ||
}, { bundled: true, cacheBoosters: true, assetHosts: 'goalsmashers.com' }) | ||
} | ||
}); |
27402
488