Repository navigation
Don't reference Pathname when building rule sources - #782
Open
sourya2704 wants to merge 1 commit into
Open
sourya2704 wants to merge 1 commit into
sourya2704 wants to merge 1 commit into
Conversation
make_sources checked `when Pathname` before `when Proc, Method`, so a rule with a proc prerequisite raised NameError on Ruby versions where pathname isn't loaded. Check for to_path instead, like Rake.from_pathname does.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #781.
make_sourcescheckedwhen Pathnamebeforewhen Proc, Method, so for a proc or method prerequisite thePathnameconstant was looked up first. On Ruby versions wherepathnamehasn't been loaded (3.4 and earlier, unless something else requires it), that raisedNameError: uninitialized constant Rake::TaskManager::Pathname.This checks
respond_to?(:to_path)instead, the same wayRake.from_pathnameandFileListdetect paths, soPathnameprerequisites still work without referencing the constant.The new functional test runs rake in a separate process with a rule that has a proc prerequisite. It fails on Ruby 3.3 without the change and passes with it.