You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happens if a and c are needed, but b isn't (based on the needed? method)?
Well, a and c will be executed.
But maybe it would have been more efficient to run only a.
So I suppose it all depends on what does actually needed? means for a Task and Rake.
I made a silly experiment where c is not executed in this case, and the test suit pass all the test, so I'm wondering if this case was overlooked or it is actually a design decision. Which in any case, a test case should be added.
Here is a simple Rakefile to test the idea:
desc'Do A'taska: [:b]dosh'echo Do A'enddesc'Do B'taskb: [:c]dosh'echo Do B'enddef(Rake::Task[:b]).needed?falseenddesc'Do C'task:cdosh'echo Do C'end
This discussion was converted from issue #434 on June 21, 2022 22:17.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Given the following task dependency graph:
What happens if
a
andc
are needed, butb
isn't (based on theneeded?
method)?Well,
a
andc
will be executed.But maybe it would have been more efficient to run only
a
.So I suppose it all depends on what does actually
needed?
means for a Task and Rake.I made a silly experiment where
c
is not executed in this case, and the test suit pass all the test, so I'm wondering if this case was overlooked or it is actually a design decision. Which in any case, a test case should be added.Here is a simple Rakefile to test the idea:
Beta Was this translation helpful? Give feedback.
All reactions