Good idea. I've added two other formats (Ant and Ruby) and you can also use
regular expressions. To use Ant tokens:
filter("src-path").into("dest-path").using(:ant, filter_map).run
Assaf
On 7/13/07, Terminus <emmanuel.pir...@gmail.com> wrote:
> Hi,
> My current Ant buid is using filters to replace some tokens in some
> files.
> Buildr support filters but they use the Ruby syntax for the tokens.
> To make porting the Ant build to Buildr, it would be nice if I could
> do :
> filter("src-path").into("dest-path").style(:ant).using(filter_map).run
> Right now I have to do :
> FILTERS= {"TOKEN" => "value"}
> FILTER_PROC= proc {|file_name, content|
> FILTERS.each_pair do |var, value|
> content.gsub!("@#{var}@", value)
> end
> content
> }
> filter("src-path").into("dest-path").using(FILTER_PROC).run
> It's not bad, but it sure would be nicer that Buildr support Ant style
> tokens.