Module: Rake::Pipeline::Web::Filters::ProjectHelpers

Defined in:
lib/rake-pipeline-web-filters/helpers.rb

Instance Method Summary collapse

Instance Method Details

#register(extension, klass) ⇒ Object

Register a filter class for a particular file extension and add a ChainedFilter as a before filter.

If this is the first use of register, it will set up the before filter. Subsequent uses will just update the types hash.

See Also:



118
119
120
121
122
123
124
125
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 118

def register(extension, klass)
  if @types_hash
    @types_hash[extension] = klass
  else
    @types_hash = { extension => klass }
    before_filter ChainedFilter, { :types => @types_hash }
  end
end