update codestyle

This commit is contained in:
2013-10-31 11:35:17 +01:00
parent f05e8df9bb
commit de49ef8d5b
2 changed files with 11 additions and 6 deletions
+8 -3
View File
@@ -85,13 +85,18 @@ module.exports = function (grunt)
function generateCss( filepath, data ) function generateCss( filepath, data )
{ {
var filetype = filepath.split( '.' ).pop().toLowerCase(); var filetype = filepath.split( '.' ).pop().toLowerCase();
var className, template; var className;
var template;
className = options.classPrefix + path.basename( data.path ).split( '.' )[0] + options.classSuffix; className = options.classPrefix + path.basename( data.path ).split( '.' )[0] + options.classSuffix;
filetype = options.usePlaceholder ? filetype : filetype + '_no'; filetype = options.usePlaceholder ? filetype : filetype + '_no';
if(options.variables) {
if (options.variables)
{
template = cssTemplates.variables; template = cssTemplates.variables;
} else { }
else
{
template = cssTemplates[ filetype ] || cssTemplates.default; template = cssTemplates[ filetype ] || cssTemplates.default;
} }
+3 -3
View File
@@ -23,14 +23,14 @@ exports.datauri = {
test.done(); test.done();
}, },
variables_option: function( test) variables_option: function( test )
{ {
test.expect( 2 ); test.expect( 2 );
var file = grunt.file.read; var file = grunt.file.read;
test.equal( file( "tmp/base64.variables.scss"), file( "test/expected/base64.variables.scss" ), "SCSS variables should be equal."); test.equal( file( "tmp/base64.variables.scss" ), file( "test/expected/base64.variables.scss" ), "SCSS variables should be equal." );
test.equal( file( "tmp/base64.variables.sass"), file( "test/expected/base64.variables.sass" ), "SASS variables should be equal."); test.equal( file( "tmp/base64.variables.sass" ), file( "test/expected/base64.variables.sass" ), "SASS variables should be equal." );
test.done(); test.done();
} }