handle nil in config options (broken in 1.2.2) #217
Merged
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.
Context
In rake-compiler 1.2.1 and earlier, if an extension did something like this, rake-compiler handled it gracefully:
It is OK to do this because in 1.2.1 and earlier, the command array was executed as:
However, this was changed in 1.2.2 to
which of course is preferable. However, this breaks extensions like nokogiri that do something silly like above.
Details
I've fixed Nokogiri (see sparklemotion/nokogiri#2894) but I do think that there may be other gems impacted by this change.
This PR does a few things:
make_makefile_cmd
so that we can unit test itnil
case, and fix it by returning the result ofcmd.compact
This is a big PR because of the extraction and test coverage. Please let me know if you would prefer this to be done a different way.