ruby / ruby/rake

Does `nowrite` ever take effect?

Open
#361 2 comments 1 reaction 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

--dry-run sets both nowrite(false) and options.dry_run = true. The thing is, so long as options.dry_run == true, Task execution short-circuits before it ever gets to execute any FileUtils methods.

So the question is... does nowrite/noop ever take effect?

The only way I can find to get Rake to tell me what it would do (without doing it) is:

$ rake -E 'Rake.nowrite(true)' 

(That's the behavior I expected from --dry-run, honestly.)

So... are the noop/nowrite branches effectively dead code? Or am I missing something?

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

Start with the task execution short-circuit in lib/rake/task.rb and compare it with the nowrite/noop behavior reached through FileUtils. Reproduce the issue using --dry-run and Rake.nowrite(true), then trace whether those branches are reachable. Done means establishing the intended behavior and documenting or reporting the required change.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.