Renames `noRebase` option into `rebase`.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Fri, 10 Oct 2014 06:45:56 +0000 (07:45 +0100)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Fri, 10 Oct 2014 20:28:49 +0000 (21:28 +0100)
History.md
README.md
bin/cleancss
lib/clean.js

index bc9d9d7..b2e8e6f 100644 (file)
@@ -7,6 +7,7 @@
   See [changes](https://github.com/jakubpawlowicz/clean-css/compare/b06f37d...dd8c14a).
 * Renames `noAdvanced` option into `advanced`.
 * Renames `noAggressiveMerging` option into `aggressiveMerging`.
+* Renames `noRebase` option into `rebase`.
 * Speeds up advanced processing by shortening optimize loop.
 * Fixed issue [#360](https://github.com/GoalSmashers/clean-css/issues/360) - adds 7 extra CSS colors.
 
index 6e11e2f..5d82b70 100644 (file)
--- a/README.md
+++ b/README.md
@@ -32,6 +32,7 @@ npm install clean-css
 
 * `noAdvanced` became `advanced` - make sure to reverse the value;
 * `noAggressiveMerging` became `aggressiveMerging` - make sure to reverse the value;
+* `noRebase` became `rebase` - make sure to reverse the value;
 * no longer possible to use `CleanCSS` as a function as `new CleanCSS` is always required;
 
 ### How to upgrade clean-css from 1.x to 2.x?
@@ -139,8 +140,8 @@ CleanCSS constructor accepts a hash as a parameter, i.e.,
 * `inliner` - a hash of options for `@import` inliner, see test/protocol-imports-test.js for examples
 * `keepBreaks` - whether to keep line breaks (default is false)
 * `keepSpecialComments` - `*` for keeping all (default), `1` for keeping first one only, `0` for removing all
-* `noRebase` - whether to skip URLs rebasing
 * `processImport` - whether to process `@import` rules
+* `rebase` - set to false to skip URL rebasing
 * `relativeTo` - path to __resolve__ relative `@import` rules and URLs
 * `root` - path to __resolve__ absolute `@import` rules and __rebase__ relative URLs
 * `roundingPrecision` - Rounding precision, defaults to 2.
index ef94f66..b8d58c6 100755 (executable)
@@ -73,7 +73,7 @@ if (commands.root)
 if (commands.skipImport)
   cleanOptions.processImport = false;
 if (commands.skipRebase)
-  cleanOptions.noRebase = true;
+  cleanOptions.rebase = false;
 if (commands.skipAdvanced)
   cleanOptions.advanced = false;
 if (commands.skipAggressiveMerging)
@@ -87,7 +87,7 @@ if (commands.debug)
 if (commands.timeout)
   cleanOptions.inliner = { timeout: parseFloat(commands.timeout) * 1000 };
 if (commands.args.length > 0) {
-  var relativeTo = (cleanOptions.noRebase ? false : cleanOptions.root) || commands.args[0];
+  var relativeTo = (cleanOptions.rebase ? cleanOptions.root : false) || commands.args[0];
   cleanOptions.relativeTo = path.dirname(path.resolve(relativeTo));
 
   options.sources = commands.args.map(function(source) {
index 791e170..3514a8d 100644 (file)
@@ -26,8 +26,8 @@ var CleanCSS = module.exports = function CleanCSS(options) {
     inliner: options.inliner,
     keepBreaks: options.keepBreaks || false,
     keepSpecialComments: 'keepSpecialComments' in options ? options.keepSpecialComments : '*',
-    noRebase: options.noRebase,
     processImport: undefined === options.processImport ? true : false,
+    rebase: undefined === options.rebase ? true : false,
     relativeTo: options.relativeTo,
     root: options.root,
     roundingPrecision: options.roundingPrecision,
@@ -141,7 +141,7 @@ function minify(data) {
   run(selectorsOptimizer, 'process');
   run(freeTextProcessor, 'restore');
   run(urlsProcessor, 'restore');
-  run(urlRebase, 'process', !options.noRebase);
+  run(urlRebase, 'process', options.rebase);
   run(expressionsProcessor, 'restore');
   run(commentsProcessor, 'restore');