bug in ArchiveTask#needed? ?

View: New views
2 Messages — Rating Filter:   Alert me  

bug in ArchiveTask#needed? ?

by Ittay Dror :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

this is some of the code of the method:

    most_recent = @paths.collect { |name, path| path.sources }.flatten

        each { |src| File.directory?(src) ?
Util.recursive_with_dot_files(src) | [src] : src }.flatten.
        select { |file| File.exist?(file) }.collect { |file|
File.stat(file).mtime }.max
      File.stat(name).mtime < (most_recent || Rake::EARLY) || super


isn't the 'each' call effectively a noop (being that each just returns
the same array)?

ittay

--
--
Ittay Dror <ittay.dror@...>



Re: bug in ArchiveTask#needed? ?

by Assaf Arkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I believe so.

Assaf

On Mon, Nov 3, 2008 at 4:57 AM, Ittay Dror <ittay.dror@...> wrote:

> this is some of the code of the method:
>
>   most_recent = @paths.collect { |name, path| path.sources }.flatten
>
>       each { |src| File.directory?(src) ? Util.recursive_with_dot_files(src)
> | [src] : src }.flatten.
>       select { |file| File.exist?(file) }.collect { |file|
> File.stat(file).mtime }.max
>     File.stat(name).mtime < (most_recent || Rake::EARLY) || super
>
>
> isn't the 'each' call effectively a noop (being that each just returns the
> same array)?
>
> ittay
>
> --
> --
> Ittay Dror <ittay.dror@...>
>
>
>