var gulp = require('gulp');
var elixir = require('laravel-elixir');
var urlAdjuster = require('gulp-css-url-adjuster');

/*
 |----------------------------------------------------------------
 | adjust css urls for images and stuff
 |----------------------------------------------------------------
 |
 | A wrapper for gulp-css-url-adjuster.
 |
 */

elixir.extend('urlAdjuster', function(input, options, output) {

    gulp.task('urlAdjuster', function() {
        gulp.src(input)
            .pipe(urlAdjuster(options))
            .pipe(gulp.dest(output));
    });

    return this.queueTask('urlAdjuster');
});

var gulp = require('gulp');
var elixir = require('laravel-elixir');
var urlAdjuster = require('gulp-css-url-adjuster');
var files = [];

/*
 |----------------------------------------------------------------
 | adjust css urls for images and stuff
 |----------------------------------------------------------------
 |
 | A wrapper for gulp-css-url-adjuster.
 |
 */

elixir.extend('urlAdjuster', function(input, options, output) {

    files.push({
        input: input,
        options: options,
        output: output
    });

    var stream;

    gulp.task('urlAdjuster', function() {
        files.forEach(function(toUrlAdjust) {
            stream = gulp.src(toUrlAdjust.input)
                         .pipe(urlAdjuster(toUrlAdjust.options))
                         .pipe(gulp.dest(toUrlAdjust.output));
        });
        
        return stream;
    });

    return this.queueTask('urlAdjuster');
});

Allow for multiple files to be urlAdjsted.