Skip to content

Fixed File.expand_path#6447

Merged
matz merged 2 commits into
mruby:masterfrom
dearblue:File.expand_path
Dec 10, 2024
Merged

Fixed File.expand_path#6447
matz merged 2 commits into
mruby:masterfrom
dearblue:File.expand_path

Conversation

@dearblue

@dearblue dearblue commented Dec 8, 2024

Copy link
Copy Markdown
Contributor
  • Improved File.expand_path test in `mruby-io

    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.

  • Fix File.expand_path for Windows

    • 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.

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.
@dearblue
dearblue requested a review from matz as a code owner December 8, 2024 01:51
@matz
matz merged commit 19cb0fc into mruby:master Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants