ruby / ruby/rake

Feature request: Point in Time as a virtual dependency

Open
#511 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
2.5k
Forks
650
Avg merge
6m
Merged PRs (30d)
3

Description

Hi,

this is a feature request.

When declaring a filetask

file somefile => someother do
   do_something
end

it is executed only if either somefile does not exist, or one of the dependencies is newer.

But quite often I have requirements to not have a file get too old, which is not exactly straightforward in Rake.

Proposal:

Allow to define a point in Time to work as a virtual dependency, e.g. something like

d=DateTime.now.prev_month

file somefile => d do
  # recreate the file
end

to not let the File get older than the given date. Should be easy to implement.

regards

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating Rake's file-task dependency handling and its existing timestamp comparison, then determine how a DateTime dependency would fit that model. Done should include defined behavior for the example and coverage for the point-in-time dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.