Fixed File.expand_path#6447
Merged
Merged
Conversation
Since `mruby-io` does not depend on `mruby-env` even for test builds, it is impossible that `ENV` constants are defined. Therefore, define `MRubyIOTestUtil::ENV_HOME` for alternative use.
- The inner method `File._gethome` could be read as intending to use the `USERPROFILE` environment variable instead on Windows when the `HOME` environment variable is not available.
In reality, however, this was not the case.
- The result of `File.expand_path` should unify path separators with `/`, but it did not.
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.
Improved
File.expand_pathtest in `mruby-ioSince
mruby-iodoes not depend onmruby-enveven for test builds, it is impossible thatENVconstants are defined.Therefore, define
MRubyIOTestUtil::ENV_HOMEfor alternative use.Fix
File.expand_pathfor WindowsFile._gethomecould be read as intending to use theUSERPROFILEenvironment variable instead on Windows when theHOMEenvironment variable is not available.In reality, however, this was not the case.
File.expand_pathshould unify path separators with/, but it did not.