Robert Klemme
6/12/2008 7:10:00 AM
2008/6/12 Clement Ow <clement.ow@asia.bnpparibas.com>:
> Clement Ow wrote:
>> Robert Klemme wrote:
>>> 2008/6/11 Clement Ow <clement.ow@asia.bnpparibas.com>:
>>>>>> Btw it's a sweet solution ;) just that do u think it would be possible
>>>>>> to incoporate multiple source paths and each source paths has an array
>>>>>> of file_exceptions?
>>>>>
>>>>> Yes. You just need to create a wrapper method around the one I posted.
>>>> What do you mean by wrapper method? care to explain? Thanks!
>>>
>>> A "wrapper method" wraps the other method, i.e. it calls the other
>>> method. You can forward the block from the outer method to the inner
>>> method like this
>>>
>>> def f(&b)
>>> x(&b)
>>> end
>>>
>>> robert
>>
> PS: Oops, i hit submit accidentally without finishing my post
> So what you are saying is I create a method to call another method which
> is already defined? But won't it be easier to directly call the method?
> Sorry, I'm abit confused here.. So how is it by creating a wrapper
> method, I would be able to pass in multiple source and dest paths, and
> exclusions?
Separation of concerns. The innder method (the version I provided)
does the traversing and the exclusion filtering and the outer method
uses the inner method to work with multiple source directories and
exclusions.
robert
--
use.inject do |as, often| as.you_can - without end