django-ember-precompile
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -22,3 +22,4 @@ var fs = require('fs'); | ||
var filename = this.args.slice(2); | ||
var templateName = filename.toString().split(path.sep + 'templates' + path.sep).reverse()[0].replace('.handlebars', ''); | ||
var extensionRegex = /.handlebars|.hbs/gi; | ||
var templateName = filename.toString().split(path.sep + 'templates' + path.sep).reverse()[0].replace(extensionRegex, ''); | ||
templateName = templateName.replace(path.sep, '/'); | ||
@@ -25,0 +26,0 @@ var template = fs.readFileSync(filename.toString(), 'utf8'); |
@@ -13,2 +13,2 @@ (function() { | ||
}).call(this) | ||
}).call(this); |
@@ -8,3 +8,3 @@ { | ||
"description": "ember.js precompiler for projects that use the django compressor", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"repository": { | ||
@@ -11,0 +11,0 @@ "type": "git", |
@@ -41,3 +41,3 @@ | ||
1.) Each template must have a file extension of "handlebars" | ||
1.) Each template must have a file extension of "handlebars" or "hbs" | ||
2.) Each template must reside under a root "templates" directory | ||
@@ -44,0 +44,0 @@ |
@@ -42,2 +42,9 @@ require('../lib/cli'); | ||
it("returns templateName without hbs extension when valid filepath passed in", function() { | ||
var tpl = path.join('file-system', 'app', 'templates', 'foo.hbs'); | ||
var sut = new Cli({args:['node', 'node_modules/django-ember-precompile/bin/django-ember-precompile', tpl]}); | ||
result = sut.parseCommandLineArgs(); | ||
expect(result['name']).toEqual('foo'); | ||
}); | ||
it("returns template content when valid filepath passed in and it exists on the filesystem", function() { | ||
@@ -44,0 +51,0 @@ var tpl = path.join('file-system', 'app', 'templates', 'foo.handlebars'); |
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
8499
14
11
96