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
I think the current implementation of the file task makes perfect sense: just trigger a series of actions based on a file's status, in case you don't necessarily want to actually produce that file.
However, in cases where you do want to produce that file, it would be nice to have a separate task type that supports that, i.e. fails if the task actions don't produce the file even when there are no exceptions thrown.
Example:
classRake::RequiredFileTask < Rake::FileTaskdefexecute(*args)super(*args)File.exists?(name)orraise"File #{name} was not created successfully"endendmoduleRake::DSLdefrequired_file(*args, &block)# :doc:Rake::RequiredFileTask.define_task(*args, &block)endend
Then, if invoked as:
required_file'a.out'do |t|
# do nothingend
an error would be thrown:
rake aborted!
File a.out was not created successfully
The text was updated successfully, but these errors were encountered:
I think the current implementation of the file task makes perfect sense: just trigger a series of actions based on a file's status, in case you don't necessarily want to actually produce that file.
However, in cases where you do want to produce that file, it would be nice to have a separate task type that supports that, i.e. fails if the task actions don't produce the file even when there are no exceptions thrown.
Example:
Then, if invoked as:
an error would be thrown:
The text was updated successfully, but these errors were encountered: