Permalink
Browse files

general cleanup and consolidation.

test refactoring. individual compile. revert normalize linefeeds for now
(breaks tests).
  • Loading branch information...
1 parent 2e3ad1a commit da9ad88862547a536b89d0f00a8eb578d2ae6efd @ctalkington ctalkington committed Sep 23, 2012
View
@@ -1,7 +1,7 @@
-Tyler Kellen (http://goingslowly.com/)
-"Cowboy" Ben Alman (http://benalman.com/)
-Chris Talkington (http://christalkington.com/)
-Teddy Cross (http://tkaz.ec/)
-Justin Searls (http://about.me/searls/)
-Thomas Boyt (http://www.thomasboyt.com/)
-Jake Harding (http://thejakeharding.com/)
+Tyler Kellen (http://goingslowly.com/)
+"Cowboy" Ben Alman (http://benalman.com/)
+Chris Talkington (http://christalkington.com/)
+Teddy Cross (http://tkaz.ec/)
+Justin Searls (http://about.me/searls/)
+Thomas Boyt (http://www.thomasboyt.com/)
+Jake Harding (http://thejakeharding.com/)
View
@@ -1,75 +1,76 @@
-# grunt-contrib-less
-> Compile LESS files to CSS (part of the [grunt-contrib](https://github.com/gruntjs/grunt-contrib) collection). Submitted by [Tyler Kellen](https://github.com/tkellen).
-
-## Getting Started
-Install this grunt plugin next to your project's [grunt.js gruntfile][getting_started] with: `npm install grunt-contrib-less`
-
-Then add this line to your project's `grunt.js` gruntfile:
-
-```javascript
-grunt.loadNpmTasks('grunt-contrib-less');
-```
-
-[grunt]: https://github.com/cowboy/grunt
-[getting_started]: https://github.com/cowboy/grunt/blob/master/docs/getting_started.md
-
-### Overview
-
-Inside your `grunt.js` file add a section named `less`. This section specifies the files to compile and the options passed to [LESS](http://lesscss.org/#-server-side-usage).
-
-#### Parameters
-
-##### files ```object```
-
-This defines what files this task will process and should contain key:value pairs.
-
-The key (destination) should be an unique filepath (supports [grunt.template](https://github.com/cowboy/grunt/blob/master/docs/api_template.md)) and the value (source) should be a filepath or an array of filepaths (supports [minimatch](https://github.com/isaacs/minimatch)).
-
-Note: When the value contains an array of multiple filepaths, the contents are concatenated in the order passed.
-
-##### options ```object```
-
-This controls how this task (and its helpers) operate and should contain key:value pairs, see options below.
-
-#### Options
-
-##### paths ```string|array```
-
-This specifies directories to scan for @import directives when parsing. Default value is the directory of the source, which is probably what you want.
-
-##### compress ```boolean```
-
-If set to `true`, the generated CSS will be minified.
-
-##### yuicompress ```boolean```
-
-If set to `true`, the generated CSS will be minified with [YUI Compressor's CSS minifier](http://developer.yahoo.com/yui/compressor/css.html).
-
-#### Config Example
-
-``` javascript
-less: {
- development: {
- options: {
- paths: ["assets/css"]
- },
- files: {
- "path/to/result.css": "path/to/source.less"
- }
- },
- production: {
- options: {
- paths: ["assets/css"],
- yuicompress: true
- },
- files: {
- "path/to/result.css": "path/to/source.less"
- }
- }
-}
-```
-
-## Release History
-
-* 2012/08/16 - v0.2.2 - Support all less options, normalize linefeeds, default path to dirname of src file.
-* 2012/08/10 - v0.2.0 - Refactored from grunt-contrib into individual repo.
+# grunt-contrib-less
+> Compile LESS files to CSS (part of the [grunt-contrib](https://github.com/gruntjs/grunt-contrib) collection). Submitted by [Tyler Kellen](https://github.com/tkellen).
+
+## Getting Started
+Install this grunt plugin next to your project's [grunt.js gruntfile][getting_started] with: `npm install grunt-contrib-less`
+
+Then add this line to your project's `grunt.js` gruntfile:
+
+```javascript
+grunt.loadNpmTasks('grunt-contrib-less');
+```
+
+[grunt]: https://github.com/cowboy/grunt
+[getting_started]: https://github.com/cowboy/grunt/blob/master/docs/getting_started.md
+
+### Overview
+
+Inside your `grunt.js` file add a section named `less`. This section specifies the files to compile and the options passed to [LESS](http://lesscss.org/#-server-side-usage).
+
+#### Parameters
+
+##### files ```object```
+
+This defines what files this task will process and should contain key:value pairs.
+
+The key (destination) should be an unique filepath (supports [grunt.template](https://github.com/cowboy/grunt/blob/master/docs/api_template.md)) and the value (source) should be a filepath or an array of filepaths (supports [minimatch](https://github.com/isaacs/minimatch)).
+
+As of v0.2.3, you can use *.{ext} as your destination filename to individually compile each file to the destination directory. Otherwise, when the source contains an array of multiple filepaths, the contents are concatenated in the order passed.
+
+##### options ```object```
+
+This controls how this task (and its helpers) operate and should contain key:value pairs, see options below.
+
+#### Options
+
+##### paths ```string|array```
+
+This specifies directories to scan for @import directives when parsing. Default value is the directory of the source, which is probably what you want.
+
+##### compress ```boolean```
+
+If set to `true`, the generated CSS will be minified.
+
+##### yuicompress ```boolean```
+
+If set to `true`, the generated CSS will be minified with [YUI Compressor's CSS minifier](http://developer.yahoo.com/yui/compressor/css.html).
+
+#### Config Example
+
+``` javascript
+less: {
+ development: {
+ options: {
+ paths: ["assets/css"]
+ },
+ files: {
+ "path/to/result.css": "path/to/source.less"
+ }
+ },
+ production: {
+ options: {
+ paths: ["assets/css"],
+ yuicompress: true
+ },
+ files: {
+ "path/to/result.css": "path/to/source.less"
+ }
+ }
+}
+```
+
+## Release History
+
+* 2012/09/24 - v0.2.3 - general cleanup and consolidation. test refactoring. revert normalize linefeeds for now.
+* 2012/09/16 - v0.2.2 - support all less options, normalize linefeeds, default path to dirname of src file.
+* 2012/09/10 - v0.2.0 - refactored from grunt-contrib into individual repo.
View
@@ -1,98 +1,106 @@
-/*
- * grunt-contrib-less
- * http://gruntjs.com/
- *
- * Copyright (c) 2012 Tyler Kellen, contributors
- * Licensed under the MIT license.
- * https://github.com/gruntjs/grunt-contrib-less/blob/master/LICENSE-MIT
- */
-
-module.exports = function(grunt) {
- 'use strict';
-
- // Project configuration.
- grunt.initConfig({
- lint: {
- all: ['grunt.js', 'tasks/*.js', '<config:nodeunit.tasks>']
- },
-
- jshint: {
- options: {
- curly: true,
- eqeqeq: true,
- immed: true,
- latedef: true,
- newcap: true,
- noarg: true,
- sub: true,
- undef: true,
- boss: true,
- eqnull: true,
- node: true,
- es5: true
- }
- },
-
- // Before generating any new files, remove any previously-created files.
- clean: {
- test: ['tmp']
- },
-
- // Configuration to be run (and then tested).
- less: {
- compile: {
- options: {
- paths: ['test/fixtures/include']
- },
- files: {
- 'tmp/less_a.css': ['test/fixtures/style.less'],
- 'tmp/less_b.css': ['test/fixtures/style.less'],
- 'tmp/less_c.css': ['test/fixtures/**/*.nomatches'],
- 'tmp/less_d.css': ['test/fixtures/style.less', 'test/fixtures/style2.less']
- }
- },
- no_paths_specified: {
- files: {
- 'tmp/less_no_paths_specified.css': ['test/fixtures/style_no_paths_specified.less'],
- }
- },
- compress: {
- options: {
- paths: ['test/fixtures/include'],
- compress: true
- },
- files: {
- 'tmp/less_a.min.css': ['test/fixtures/style.less']
- }
- },
- yuicompress: {
- options: {
- paths: ['test/fixtures/include'],
- yuicompress: true
- },
- files: {
- 'tmp/less_a.yuimin.css': ['test/fixtures/style.less']
- }
- }
- },
-
- // Unit tests.
- nodeunit: {
- tasks: ['test/*_test.js']
- }
- });
-
- // Actually load this plugin's task(s).
- grunt.loadTasks('tasks');
-
- // The clean plugin helps in testing.
- grunt.loadNpmTasks('grunt-contrib-clean');
-
- // Whenever the "test" task is run, first clean the "tmp" dir, then run this
- // plugin's task(s), then test the result.
- grunt.renameTask('test', 'nodeunit');
- grunt.registerTask('test', 'clean less nodeunit');
-
- // By default, lint and run all tests.
- grunt.registerTask('default', 'lint test');
-};
+/*
+ * grunt-contrib-less
+ * http://gruntjs.com/
+ *
+ * Copyright (c) 2012 Tyler Kellen, contributors
+ * Licensed under the MIT license.
+ * https://github.com/gruntjs/grunt-contrib-less/blob/master/LICENSE-MIT
+ */
+
+module.exports = function(grunt) {
+ 'use strict';
+
+ // Project configuration.
+ grunt.initConfig({
+ lint: {
+ all: ['grunt.js', 'tasks/*.js', '<config:nodeunit.tasks>']
+ },
+
+ jshint: {
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ undef: true,
+ boss: true,
+ eqnull: true,
+ node: true,
+ es5: true
+ }
+ },
+
+ // Before generating any new files, remove any previously-created files.
+ clean: {
+ test: ['tmp']
+ },
+
+ // Configuration to be run (and then tested).
+ less: {
+ compile: {
+ options: {
+ paths: ['test/fixtures/include']
+ },
+ files: {
+ 'tmp/less.css': ['test/fixtures/style.less'],
+ 'tmp/concat.css': ['test/fixtures/style.less', 'test/fixtures/style2.less'],
+ 'tmp/individual/*.css': ['test/fixtures/style*.less', 'test/fixtures/level2/*.less']
+ }
+ },
+ compress: {
+ options: {
+ paths: ['test/fixtures/include'],
+ compress: true
+ },
+ files: {
+ 'tmp/compress.css': ['test/fixtures/style.less']
+ }
+ },
+ flatten: {
+ files: {
+ 'tmp/individual_flatten/*.css': ['test/fixtures/style*.less', 'test/fixtures/level2/*.less']
+ },
+ options: {
+ flatten: true,
+ paths: ['test/fixtures/include']
+ },
+ },
+ nopaths: {
+ files: {
+ 'tmp/nopaths.css': ['test/fixtures/nopaths.less'],
+ }
+ },
+ yuicompress: {
+ options: {
+ paths: ['test/fixtures/include'],
+ yuicompress: true
+ },
+ files: {
+ 'tmp/yuicompress.css': ['test/fixtures/style.less']
+ }
+ }
+ },
+
+ // Unit tests.
+ nodeunit: {
+ tasks: ['test/*_test.js']
+ }
+ });
+
+ // Actually load this plugin's task(s).
+ grunt.loadTasks('tasks');
+
+ // The clean plugin helps in testing.
+ grunt.loadNpmTasks('grunt-contrib-clean');
+
+ // Whenever the "test" task is run, first clean the "tmp" dir, then run this
+ // plugin's task(s), then test the result.
+ grunt.renameTask('test', 'nodeunit');
+ grunt.registerTask('test', 'clean less nodeunit');
+
+ // By default, lint and run all tests.
+ grunt.registerTask('default', 'lint test');
+};
Oops, something went wrong. Retry.

0 comments on commit da9ad88

Please sign in to comment.