tasks/sass_bootstrapper.js
function parseFile(importKeyword, requiresKeyword, filePath) {
        var _lines  = grunt.file.read(filePath).split(NEW_LINE),
            _values = {
                imports: {},
                requires: {}
            };

        // Search for keywords in file
        for (var i = _lines.length - 1; i >= 0; i--) {
            var line = _lines[i];

            if (line.indexOf(importKeyword) !== -1) {
                // get import value
                var _importValue = line.match(/("|')(.*?)("|')/)[2];

                // Create full path to help looking for file and minimalize
                // errors if there are duplicated filenames
                _importValue = Path.join(Path.dirname(filePath), _importValue.sassToPath());
                // Windows support. Replace backslashes into slashes.
                _importValue = _importValue.replace(/\\/g, "/");
                // Append new import value to list
                _values.imports['import' + i] = _importValue;
            }

            if (line.indexOf(requiresKeyword) !== -1) {
                // get require value
                var _requireValue = line.match(/("|')(.*?)("|')/)[2];

                // Create new dependency object
                var _requireObject = {
                    requires: _requireValue.sassToPath(),
                    fileName: filePath
                };
                // Append new require value to list
                _values.requires['require' + i] = _requireObject;
            }
        }
        return _values;
    }
function parseFile(importKeyword, requiresKeyword, filePath) {
        var _lines  = grunt.file.read(filePath).split(NEW_LINE),
            _values = {
                imports: {},
                requires: {}
            };

        // Search for keywords in file
        for (var i = _lines.length - 1; i >= 0; i--) {
            var line = _lines[i];

            if (line.indexOf(importKeyword) !== -1) {
                // get import value
                var _importValue = line.match(/("|')(.*?)("|')/)[2];

                // Create full path to help looking for file and minimalize
                // errors if there are duplicated filenames
                _importValue = Path.join(Path.dirname(filePath), _importValue.sassToPath());
                // Windows support. Replace backslashes into slashes.
                _importValue = _importValue.replace(/\\/g, "/");
                // Append new import value to list
                _values.imports['import' + i] = _importValue;
            }

            if (line.indexOf(requiresKeyword) !== -1) {
                // get require value
                var _requireValue = line.match(/("|')(.*?)("|')/)[2];

                // Create new dependency object
                var _requireObject = {
                    requires: _requireValue.sassToPath(),
                    fileName: filePath
                };
                // Append new require value to list
                _values.requires['require' + i] = _requireObject;
            }
        }
        return _values;
    }
function parseFile ( importKeyword , requiresKeyword , filePath ) { var _lines = grunt . file . read ( filePath ) . split ( NEW_LINE ) , _values = { imports : { } , requires : { } } ; // Search for keywords in file for ( var i = _lines . length - 1 ; i >= 0 ; i -- ) { var line = _lines [ i ] ; if ( line . indexOf ( importKeyword ) !== - 1 ) { // get import value var _importValue = line . match ( / ("|')(.*?)("|') / ) [ 2 ] ; // Create full path to help looking for file and minimalize // errors if there are duplicated filenames _importValue = Path . join ( Path . dirname ( filePath ) , _importValue . sassToPath ( ) ) ; // Windows support. Replace backslashes into slashes. _importValue = _importValue . replace ( / \\ / g , "/" ) ; // Append new import value to list _values . imports [ 'import' + i ] = _importValue ; } if ( line . indexOf ( requiresKeyword ) !== - 1 ) { // get require value var _requireValue = line . match ( / ("|')(.*?)("|') / ) [ 2 ] ; // Create new dependency object var _requireObject = { requires : _requireValue . sassToPath ( ) , fileName : filePath } ; // Append new require value to list _values . requires [ 'require' + i ] = _requireObject ; } } return _values ; }
Parses the given file for import keywords and DI keywords

@param importKeyword {string} sass import keyword
@param requiresKeyword {string} dependency injection keyword
@param filePath {string} file to be parsed
@returns {Object} list of all founded import values
Parses the given file for import keywords and DI keywords