From 8c4420698ab43c017b469a954f7483bd77670c48 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 30 Dec 2014 18:00:20 -0800 Subject: Change css_flip => cssflip in filenames to match task name Closes #6 by merging it. --- tasks/css_flip.js | 34 ---------------------------------- tasks/cssflip.js | 34 ++++++++++++++++++++++++++++++++++ test/css_flip_test.js | 48 ------------------------------------------------ test/cssflip_test.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+), 82 deletions(-) delete mode 100644 tasks/css_flip.js create mode 100644 tasks/cssflip.js delete mode 100644 test/css_flip_test.js create mode 100644 test/cssflip_test.js diff --git a/tasks/css_flip.js b/tasks/css_flip.js deleted file mode 100644 index 71ffd31..0000000 --- a/tasks/css_flip.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * grunt-css-flip - * https://github.com/twbs/grunt-css-flip - * - * Copyright (c) 2014 Chris Rebert - * Licensed under the MIT License. - */ - -'use strict'; - -var flip = require('css-flip'); - - -module.exports = function (grunt) { - grunt.registerMultiTask('cssflip', 'Grunt plugin for Twitter\'s css-flip', function () { - var options = this.options({}); - - this.files.forEach(function (f) { - var originalCss = grunt.file.read(f.src); - - var flippedCss = null; - try { - flippedCss = flip(originalCss, options); - } - catch (err) { - grunt.fail.warn(err); - } - - grunt.file.write(f.dest, flippedCss); - - grunt.log.writeln('File "' + f.dest.cyan + '" created.'); - }); - }); -}; diff --git a/tasks/cssflip.js b/tasks/cssflip.js new file mode 100644 index 0000000..71ffd31 --- /dev/null +++ b/tasks/cssflip.js @@ -0,0 +1,34 @@ +/* + * grunt-css-flip + * https://github.com/twbs/grunt-css-flip + * + * Copyright (c) 2014 Chris Rebert + * Licensed under the MIT License. + */ + +'use strict'; + +var flip = require('css-flip'); + + +module.exports = function (grunt) { + grunt.registerMultiTask('cssflip', 'Grunt plugin for Twitter\'s css-flip', function () { + var options = this.options({}); + + this.files.forEach(function (f) { + var originalCss = grunt.file.read(f.src); + + var flippedCss = null; + try { + flippedCss = flip(originalCss, options); + } + catch (err) { + grunt.fail.warn(err); + } + + grunt.file.write(f.dest, flippedCss); + + grunt.log.writeln('File "' + f.dest.cyan + '" created.'); + }); + }); +}; diff --git a/test/css_flip_test.js b/test/css_flip_test.js deleted file mode 100644 index b62ced7..0000000 --- a/test/css_flip_test.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -var grunt = require('grunt'); - -/* - ======== A Handy Little Nodeunit Reference ======== - https://github.com/caolan/nodeunit - - Test methods: - test.expect(numAssertions) - test.done() - Test assertions: - test.ok(value, [message]) - test.equal(actual, expected, [message]) - test.notEqual(actual, expected, [message]) - test.deepEqual(actual, expected, [message]) - test.notDeepEqual(actual, expected, [message]) - test.strictEqual(actual, expected, [message]) - test.notStrictEqual(actual, expected, [message]) - test.throws(block, [error], [message]) - test.doesNotThrow(block, [error], [message]) - test.ifError(value) -*/ - -exports.cssflip = { - setUp: function (done) { - // setup here if necessary - done(); - }, - defaultOptions: function (test) { - test.expect(1); - - var actual = grunt.file.read('tmp/default_options.css'); - var expected = grunt.file.read('test/expected/default_options.css'); - test.equal(actual, expected, 'should flip the CSS.'); - - test.done(); - }, - customOptions: function (test) { - test.expect(1); - - var actual = grunt.file.read('tmp/custom_options.css'); - var expected = grunt.file.read('test/expected/custom_options.css'); - test.equal(actual, expected, 'should flip the CSS while honoring the custom indentation specified in the options.'); - - test.done(); - } -}; diff --git a/test/cssflip_test.js b/test/cssflip_test.js new file mode 100644 index 0000000..b62ced7 --- /dev/null +++ b/test/cssflip_test.js @@ -0,0 +1,48 @@ +'use strict'; + +var grunt = require('grunt'); + +/* + ======== A Handy Little Nodeunit Reference ======== + https://github.com/caolan/nodeunit + + Test methods: + test.expect(numAssertions) + test.done() + Test assertions: + test.ok(value, [message]) + test.equal(actual, expected, [message]) + test.notEqual(actual, expected, [message]) + test.deepEqual(actual, expected, [message]) + test.notDeepEqual(actual, expected, [message]) + test.strictEqual(actual, expected, [message]) + test.notStrictEqual(actual, expected, [message]) + test.throws(block, [error], [message]) + test.doesNotThrow(block, [error], [message]) + test.ifError(value) +*/ + +exports.cssflip = { + setUp: function (done) { + // setup here if necessary + done(); + }, + defaultOptions: function (test) { + test.expect(1); + + var actual = grunt.file.read('tmp/default_options.css'); + var expected = grunt.file.read('test/expected/default_options.css'); + test.equal(actual, expected, 'should flip the CSS.'); + + test.done(); + }, + customOptions: function (test) { + test.expect(1); + + var actual = grunt.file.read('tmp/custom_options.css'); + var expected = grunt.file.read('test/expected/custom_options.css'); + test.equal(actual, expected, 'should flip the CSS while honoring the custom indentation specified in the options.'); + + test.done(); + } +}; -- cgit v1.2.3