grunt-compass
Advanced tools
Comparing version 0.3.6 to 0.3.7
12
grunt.js
module.exports = function(grunt) { | ||
'use strict'; | ||
@@ -6,6 +7,9 @@ // Project configuration. | ||
compass: { | ||
dev: { | ||
test: { | ||
specify: 'test/sass/**/*.scss', | ||
outputstyle: 'compressed', | ||
linecomments: false, | ||
src: 'test/sass', | ||
dest: 'test/css' | ||
dest: 'test/css', | ||
debugsass: true | ||
} | ||
@@ -46,5 +50,5 @@ }, | ||
// Default task. | ||
grunt.registerTask('default', 'lint test'); | ||
grunt.registerTask('default', 'test lint'); | ||
grunt.registerTask('testCompass', 'compass-clean compass:dev'); | ||
}; |
{ | ||
"name": "grunt-compass", | ||
"description": "A custom grunt.js task that executes compass compile for you and prints the COMPASS output to grunt.log.write().", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"homepage": "https://github.com/kahlil/grunt-compass", | ||
@@ -29,7 +29,17 @@ "author": { | ||
}, | ||
"scripts": { | ||
"test": "nodeunit test/*" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"grunt": ">=0.3.7" | ||
"grunt": ">=0.3.7", | ||
"nodeunit": "~0.7.4" | ||
}, | ||
"keywords": ["grunt.js", "sass", "compass", "grunt", "gruntplugin"] | ||
} | ||
"keywords": [ | ||
"grunt.js", | ||
"sass", | ||
"compass", | ||
"grunt", | ||
"gruntplugin" | ||
] | ||
} |
# grunt-compass | ||
[![Build Status](https://secure.travis-ci.org/kahlil/grunt-compass.png)](http://travis-ci.org/kahlil/grunt-compass) | ||
This is a custom grunt.js multitask aka [gruntplugin](http://jsfiddle.net/cowboy/qzRjD/show/) that executes `compass compile` on the command line for you and prints the COMPASS output to `grunt.log.write()`. | ||
@@ -49,3 +52,3 @@ | ||
Note a SASS/SCSS file will be ignored if its filename begin with an underscore `_`. And all files you specify **MUST** under directory the `src` specified. | ||
Note a SASS/SCSS file will be ignored if its filename begin with an underscore `_`. And all files you specify **MUST** be under the directory that you specified with `src`. | ||
@@ -69,8 +72,17 @@ See [SASS-partials](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#partials). | ||
``` | ||
9. You can require a given ruby library before running commands like this: | ||
9. You can require ruby libraries before running commands like this: | ||
```javascript | ||
require: 'animate-sass mylib' | ||
require: 'animate-sass' | ||
``` | ||
or | ||
```javascript | ||
require: [ | ||
'animate-sass', | ||
'mylib' | ||
] | ||
``` | ||
10. You can add the `--debug-info` option for use with [FireSass](https://addons.mozilla.org/en-US/firefox/addon/firesass-for-firebug/) like so: | ||
@@ -141,3 +153,6 @@ | ||
forcecompile: true, | ||
require: 'animate-sass mylib', | ||
require: [ | ||
'animate-sass', | ||
'mylib' | ||
], | ||
debugsass: true, | ||
@@ -153,3 +168,6 @@ images: '/path/to/images', | ||
forcecompile: true, | ||
require: 'animate-sass mylib', | ||
require: [ | ||
'animate-sass', | ||
'mylib' | ||
], | ||
debugsass: false, | ||
@@ -172,17 +190,19 @@ images: '/path/to/images', | ||
v0.3.2 add support for IMPORT_PATH | ||
v0.3.6: @shama added grunt v0.4 compatibility and the grunt-contrib style of structuring gruntplugins. Also: first tests! | ||
v0.3.1 adds compiling of single files or a minimatch path via the `src` option | ||
v0.3.2: add support for IMPORT_PATH | ||
v0.2.14: @[nebelschwade](https://github.com/nebelschwade) added `fonts-dir` option and fixed issue with config.rb due to changes in last version. | ||
v0.3.1: adds compiling of single files or a minimatch path via the `src` option | ||
v0.2.13: Added `grunt.template.process()` function to process `src` and `dest` paths. Suggested by @[necolas](https://github.com/necolas) in issue #9. | ||
v0.2.14: @nebelschwade added `fonts-dir` option and fixed issue with config.rb due to changes in last version. | ||
v0.2.12: The option to set the image path for spriting and the relativeassets to true have been added by @[gcpantazis](https://github.com/gcpantazis). | ||
v0.2.13: Added `grunt.template.process()` function to process `src` and `dest` paths. Suggested by @necolas in issue #9. | ||
v0.2.11: @[gcpantazis](https://github.com/gcpantazis) added the option to set the `--debug-info` flag for Sass, useful for integration with the FireSass debugger. | ||
v0.2.12: The option to set the image path for spriting and the relativeassets to true have been added by @gcpantazis. | ||
v0.2.11: @gcpantazis added the option to set the `--debug-info` flag for Sass, useful for integration with the FireSass debugger. | ||
v0.2.10: Added 'gruntplugin' as a keyword in the package.json to get listed [here](http://jsfiddle.net/cowboy/qzRjD/show/). | ||
v0.2.9: Ability to require a given ruby lib before running commands. Added by @[FGRibreau](https://github.com/FGRibreau). | ||
v0.2.9: Ability to require a given ruby lib before running commands. Added by @FGRibreau. | ||
@@ -189,0 +209,0 @@ v0.2.8: Added an option to force compilation of SASS files via the `--force` option. |
@@ -97,3 +97,10 @@ exports.init = function( grunt ) { | ||
if ( libRequire !== undefined ) { | ||
command += ' --require '+ libRequire; | ||
if ( require('util').isArray(libRequire) ) { | ||
libRequire.forEach(function(lib) { | ||
command += ' --require '+ lib; | ||
}); | ||
} | ||
else { | ||
command += ' --require '+ libRequire; | ||
} | ||
} | ||
@@ -132,2 +139,2 @@ | ||
return exports; | ||
}; | ||
}; |
@@ -1,3 +0,3 @@ | ||
var grunt = require( 'grunt' ); | ||
var compass = require('../tasks/lib/compass').init(grunt); | ||
var grunt = require( 'grunt' ); | ||
var compass = require( '../tasks/lib/compass' ).init( grunt ); | ||
@@ -25,20 +25,148 @@ /* | ||
exports[ 'compass' ] = { | ||
setUp: function( done ) { | ||
// setup here | ||
done(); | ||
}, | ||
command: function( test ) { | ||
test.expect( 1 ); | ||
setUp: function( done ) { | ||
'use strict'; | ||
// Options object | ||
var data = { | ||
src: 'sass', | ||
dest: 'css' | ||
}; | ||
// setup here | ||
done(); | ||
}, | ||
dirs: function( test ) { | ||
'use strict'; | ||
test.equal( compass.buildCommand( data ), | ||
'compass compile --sass-dir="sass" --css-dir="css"', | ||
'should return the correct command.' ); | ||
test.done(); | ||
} | ||
var dataSet; | ||
test.expect( 1 ); | ||
// Options object | ||
dataSet = { | ||
src: 'sass', | ||
dest: 'css' | ||
}; | ||
test.equal( compass.buildCommand( dataSet ), | ||
'compass compile --sass-dir="sass" --css-dir="css"', | ||
'should return the correct command.' ); | ||
test.done(); | ||
}, | ||
specify: function( test ) { | ||
'use strict'; | ||
var dataSet1, dataSet2; | ||
// Expect two tests to be run | ||
test.expect( 2 ); | ||
// Test minimatch option | ||
dataSet1 = { | ||
specify: 'test/sass/**/*.scss', | ||
src: 'sass', | ||
dest: 'css' | ||
}; | ||
test.equal( compass.buildCommand( dataSet1 ), | ||
'compass compile --sass-dir="sass" --css-dir="css" test/sass/other.scss test/sass/test.scss', | ||
'should return the correct command.' ); | ||
// Test specific file | ||
dataSet2 = { | ||
specify: 'test/sass/other.scss', | ||
src: 'sass', | ||
dest: 'css' | ||
}; | ||
test.equal( compass.buildCommand( dataSet2 ), | ||
'compass compile --sass-dir="sass" --css-dir="css" test/sass/other.scss', | ||
'should return the correct command.' ); | ||
test.done(); | ||
}, | ||
outputstyle: function( test ) { | ||
'use strict'; | ||
var dataSet; | ||
test.expect( 1 ); | ||
// Options object | ||
dataSet = { | ||
src: 'sass', | ||
dest: 'css', | ||
outputstyle: 'compressed' | ||
}; | ||
test.equal( compass.buildCommand( dataSet ), | ||
'compass compile --sass-dir="sass" --css-dir="css" --output-style compressed', | ||
'should return the correct command.' ); | ||
test.done(); | ||
}, | ||
linecomments: function( test ) { | ||
'use strict'; | ||
var dataSet; | ||
test.expect( 1 ); | ||
// Options object | ||
dataSet = { | ||
src: 'sass', | ||
dest: 'css', | ||
linecomments: false | ||
}; | ||
test.equal( compass.buildCommand( dataSet ), | ||
'compass compile --sass-dir="sass" --css-dir="css" --no-line-comments', | ||
'should return the correct command.' ); | ||
test.done(); | ||
}, | ||
debugsass: function( test ) { | ||
'use strict'; | ||
var dataSet; | ||
test.expect( 1 ); | ||
// Options object | ||
dataSet = { | ||
src: 'sass', | ||
dest: 'css', | ||
debugsass: true | ||
}; | ||
test.equal( compass.buildCommand( dataSet ), | ||
'compass compile --sass-dir="sass" --css-dir="css" --debug-info', | ||
'should return the correct command.' ); | ||
test.done(); | ||
}, | ||
require: function( test ) { | ||
'use strict'; | ||
var dataSet; | ||
test.expect( 2 ); | ||
// Options object | ||
dataSet = { | ||
src: 'sass', | ||
dest: 'css', | ||
require: 'susy' | ||
}; | ||
test.equal( compass.buildCommand( dataSet ), | ||
'compass compile --sass-dir="sass" --css-dir="css" --require susy', | ||
'should return the correct command.' ); | ||
dataSet.require = [ | ||
'susy', | ||
'respond-to' | ||
]; | ||
test.equal( compass.buildCommand( dataSet ), | ||
'compass compile --sass-dir="sass" --css-dir="css" --require susy --require respond-to', | ||
'should return the correct command.' ); | ||
test.done(); | ||
} | ||
}; |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
21748
17
335
232
2
2