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:


130
131
132
133
134
135
136
137
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 130

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