broccoli-webfont
Advanced tools
Comparing version 0.0.2 to 0.1.0
11
index.js
@@ -18,11 +18,14 @@ var path = require('path') | ||
Webfont.prototype.updateCache = function(srcDir, destDir, files) { | ||
var _this = this | ||
if (!files.length) return | ||
var webfontsOptions = _.extend({}, this.options) | ||
_.each(['dest', 'cssDest', 'htmlDest'], function(option) { | ||
var value = _this.options[option] | ||
var value = this.options[option] | ||
if (value !== undefined) webfontsOptions[option] = path.join(destDir, value) | ||
}, this) | ||
webfontsOptions.files = _.map(files, function(file) { | ||
return path.join(srcDir, file) | ||
}) | ||
var absFiles = _.map(files, function(file) { return path.join(srcDir, file) }) | ||
webfontsOptions.files = absFiles | ||
if (webfontsOptions.dest === undefined) webfontsOptions.dest = destDir | ||
return Q.nfcall(webfontsGenerator, webfontsOptions) | ||
@@ -29,0 +32,0 @@ } |
{ | ||
"name": "broccoli-webfont", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"description": "Broccoli plugin that generates webfonts from SVG icons.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,2 +26,11 @@ var assert = require('assert') | ||
it('do nothing when no files found', function() { | ||
var tree = webfont(DIR, {files: ['nofile']}) | ||
builder = new broccoli.Builder(tree) | ||
return builder.build().then(function(result) { | ||
var files = fs.readdirSync(result.directory) | ||
assert.deepEqual(files, []) | ||
}) | ||
}) | ||
it('uses glob patterns', function() { | ||
@@ -28,0 +37,0 @@ var tree = webfont(DIR, { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12535
89