var gulp         = require('gulp')
  , _            = require('lodash')
  , iconsManager = require('../../src/middleware/icons')

/**
 * Default config
 *
 * @type {object}
 */
exports.defaultConfig = {
  fontName : 'custom',
  size     : 24,
  prefix   : 'sm-'
};

/**
 * Gulp task
 *
 * @param config Icon bundle configuration
 * @returns {*}
 */
exports.task = function(config) {

  return gulp.src(config.sets);

};

/**
 * Listener function
 *
 * @param codepoints Icon information
 * @param config     Main configuration
 */
exports.codepoints = function(codepoints, config) {

  var icons = {}
    , regex = new RegExp('ic_(.+)_([0-9x]+px)$', 'i')
    , matchs
    , iconName

  _.forEach(codepoints, function(object) {

    //matchs   = regex.exec(object.name);
    iconName = object.name.replace(/.svg/gi, '');

    icons[iconName] = object.codepoint.toString(16);
  });

  iconsManager.add(config, icons);
};


@@ -254,16 +254,33 @@
  : 'sm-'
+,%0A  sets     : %5B%5D
 %0A%7D;%0A%0A/**
@@ -615,75 +615,8 @@
  %7B%7D%0A
-    , regex = new RegExp('ic_(.+)_(%5B0-9x%5D+px)$', 'i')%0A    , matchs%0A
     
@@ -675,50 +675,8 @@
  %7B%0A%0A
-    //matchs   = regex.exec(object.name);%0A
     
@@ -711,18 +711,16 @@
 ce(/
-.svg
+_
 /gi, '
+-
 ');%0A

Clean up custom SVG icon task. Normalize input with default config