<commit_before>module.exports = (gulp, config) ->
	q         = require 'q'
	gulpif    = require 'gulp-if'
	minifyCss = require 'gulp-minify-css'

	runTask = (appOrRb) ->
		defer  = q.defer()
		minify = config.minify.css.styles
		gulp.src config.glob.dist[appOrRb].client.styles.all
			.pipe gulpif minify, minifyCss()
			.pipe gulp.dest config.dist[appOrRb].client.styles.dir
			.on 'end', ->
				console.log "minified #{appOrRb} dist styles".yellow
				defer.resolve()
		defer.promise

	runTasks = ->
		defer = q.defer()
		q.all([
			runTask 'rb'
			runTask 'app'
		]).done -> defer.resolve()
		defer.promise

	# register task
	# =============
	gulp.task "#{config.rb.prefix.task}minify-css", ->
		runTasks()<commit_msg>fix(minify): ensure css doesn't break the build on really large files<commit_after>module.exports = (gulp, config) ->
	q         = require 'q'
	gulpif    = require 'gulp-if'
	minifyCss = require 'gulp-minify-css'
	minOpts   = advanced: false

	runTask = (appOrRb) ->
		defer  = q.defer()
		minify = config.minify.css.styles
		gulp.src config.glob.dist[appOrRb].client.styles.all
			.pipe gulpif minify, minifyCss minOpts
			.pipe gulp.dest config.dist[appOrRb].client.styles.dir
			.on 'end', ->
				console.log "minified #{appOrRb} dist styles".yellow
				defer.resolve()
		defer.promise

	runTasks = ->
		defer = q.defer()
		q.all([
			runTask 'rb'
			runTask 'app'
		]).done -> defer.resolve()
		defer.promise

	# register task
	# =============
	gulp.task "#{config.rb.prefix.task}minify-css", ->
		runTasks()
{'fraction_non_alphanumeric': 0.16568819308545335, 'fraction_numerical': 0.0, 'mean_word_length': 3.1571815718157183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3688968', 'n_tokens_mistral': 639, 'n_tokens_neox': 571, 'n_words': 117}