Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Repository files navigation

ruby-file-expand-path

GitHub Actions Twitter
Crate API API trunk

Implements file path expansion and normalization routines from MRI Ruby.

A new function (normalize or make_absolute or something, bikeshed away) should be added that will turn a relative path into an absolute path without touching the filesystem. (rust-lang/rust#59117).

This crate normalizes and absolutizes paths according to the logic in Ruby v3.0.2 for POSIX and Win32.

Usage

Add this to your Cargo.toml:

[dependencies]
ruby-file-expand-path = "0.1.0"

Then normalize paths like:

assert_eq!(
    ruby_file_expand_path::expand("/home/artichoke/scripts/../run.sh"),
    Ok(b"/home/artichoke/run.sh")
);

License

ruby-file-expand-path is licensed under the MIT License (c) Ryan Lopopolo.

ruby-file-expand-path is derived from ruby @ v3.0.2. ruby is dual licensed under the Ruby License or 2-clause BSD License Copyright (c) Yukihiro Matsumoto <matz@netlab.jp>. A copy of the Ruby License can be found in COPYING in this repository.

About

📂 Rust port of path normalization from MRI Ruby.

Topics

Resources

Contributing

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages