 es         = require 'event-stream'
 ngClassify = require 'ng-classify'
+gutil      = require 'gulp-util'
 
 module.exports = (opt) ->
 	modifyFile = (file) ->

			@emit 'data', file

		return if file.isStream()
			@emit 'error', new Error 'gulp-ngClassify: Streaming not supported'

		str = file.contents.toString 'utf8'
		data = ''

			options    = if isFunction then opt(file) else opt
			data       = ngClassify str, options
		catch err
			return @emit 'error', new gutil.PluginError 'gulp-ng-classify', err

		file.contents = new Buffer data

		@emit 'data', file

	es.through modifyFile
