libpath.Ruby
Path parsing library, for Ruby
Table of Contents
Introduction
libpath is a path-parsing and utility library. It is concerned entirely with paths, as opposed to file-system entities.
The first libpath library was a C library with a C++ wrapper. There have been several implementations in other languages. libpath.Ruby is the Ruby version.
Installation
Install via gem as in:
gem install libpath-ruby
or add it to your Gemfile.
Use via require, as in:
require 'libpath'
Components
The main components of libpath.Ruby are:
LibPath::Form— path-form classification and probes (classify_path,path_is_absolute?,path_is_homed?,path_is_rooted?,name_is_malformed?);LibPath::Path::ParsedPath— structured parse of a path string into directory / file / search-relative attributes (platform-selected Unix or Windows implementation);LibPath::Util— path combination and rewriting (combine_paths,derive_relative_path,make_compare_path,make_path_absolute,make_path_canonical);LibPath::Constants— platform path-name / path / shell character constants;LibPath::Exceptions— path-related exceptions such asMalformedNameException;
Platform-specific details live under ::Unix / ::Windows submodules; the top-level Form, Path, and Util modules select the ambient OS automatically.
Examples
Examples are provided in the examples directory, along with a markdown description for each. A detailed list TOC of them is provided in EXAMPLES.md.
Project Information
Where to get help
Contribution guidelines
Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/libpath.Ruby.
Dependencies
Efferent (fan-out)
Libraries upon which libpath.Ruby depends:
Runtime Dependencies (aka "Normal Dependencies")
- <none>;
Development Dependencies
Afferent (fan-in)
Projects that depend on libpath.Ruby:
Runtime dependents
- <none>;
NOTE: recls.Ruby version 3+ is planned to depend on libpath.Ruby (it currently has its own path-parsing logic).
Development dependents
- <none>;
Related projects
- libpath (C/C++);
- libpath.Go;
- libpath.Python;
- libpath.Rust;
libpath.Ruby is based on the C/C++ libpath library, which itself was prompted by a request on the STLSoft project by my friend and esteemed programmer Adi Shavit.
License
libpath.Ruby is released under the 3-clause BSD license. See LICENSE for details.