wycats / rake-pipeline-web-filters

MIT License
116 stars 36 forks source link

Allow passing options to the ChainedFilter via an Array #64

Closed ahx closed 6 years ago

ahx commented 11 years ago

The ChainedFilter is really handy. I wanted to adjust the used filters a little, so this patch allows to pass options via an Array like:

filter Web::Filters::ChainedFilter, {
  types: {
    erb: [Web::Filters::TiltFilter, {}, my_context],
    haml: [Web::Filters::TiltFilter, {}, my_context],
    coffee: CoffeeScriptFilter
  }
}

I chose an Array to pass the options, because it's easy and resembles the filter syntax filter MyClass, option1, option2.

I am not using #register right now. You could also pass an Array to that method, but maybe we should change the register method to allow something like register :type, MyFilter, option1, option2, ping me if you think that's a good idea.

ahx commented 6 years ago

Bye Bye. Keep on rocking!