Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

artichoke/ruby-file-expand-path

Repository files navigation

ruby-file-expand-path

GitHub Actions Discord 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

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  
Morty Proxy This is a proxified and sanitized view of the page, visit original site.