@@ -9,7 +9,7 @@ var vfs = require('vow-fs');
99 * @name Comb
1010 */
1111var Comb = function ( ) {
12- this . _rules = {
12+ this . _options = {
1313 'colon-space' : { } ,
1414 'rule-indent' : { } ,
1515 'sort-order' : { } ,
@@ -24,18 +24,15 @@ Comb.prototype = {
2424
2525 /**
2626 * Loads configuration from JSON.
27- * Activates and configures required rules .
27+ * Activates and configures required options .
2828 *
2929 * @param {Object } config
3030 */
3131 configure : function ( config ) {
32- for ( var rule in config ) {
33- if ( config . hasOwnProperty ( rule ) && config [ rule ] && this . _rules [ rule ] ) {
34- var beautifier ;
32+ for ( var option in config ) {
33+ if ( config . hasOwnProperty ( option ) && config [ option ] && this . _options [ option ] ) {
3534 try {
36- beautifier = require ( './rules/' + rule ) ;
37- beautifier . value = config [ rule ] ;
38- this . _config [ rule ] = beautifier ;
35+ this . _config [ option ] = require ( './options/' + option ) . setValue ( config [ option ] ) ;
3936 } catch ( e ) { }
4037 }
4138 }
@@ -65,9 +62,9 @@ Comb.prototype = {
6562 node . forEach ( function ( node ) {
6663 if ( ! Array . isArray ( node ) ) return ;
6764 var nodeType = node . shift ( ) ;
68- for ( var rule in config ) {
69- if ( config . hasOwnProperty ( rule ) ) {
70- config [ rule ] . process ( nodeType , node ) ;
65+ for ( var option in config ) {
66+ if ( config . hasOwnProperty ( option ) ) {
67+ config [ option ] . process ( nodeType , node ) ;
7168 }
7269 }
7370 node . unshift ( nodeType ) ;
0 commit comments