{"id":20481147,"url":"https://github.com/envygeeks/pathutil","last_synced_at":"2025-06-20T17:06:39.157Z","repository":{"id":3532635,"uuid":"49878295","full_name":"envygeeks/pathutil","owner":"envygeeks","description":":dash: A faster pure Ruby implementation of Pathname with extra bits.","archived":false,"fork":false,"pushed_at":"2022-04-03T18:38:06.000Z","size":130,"stargazers_count":11,"open_issues_count":3,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-08T18:07:52.451Z","etag":null,"topics":["pathname","pathutil","ruby","stdlib-replacement","stdout"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/envygeeks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/codeowners","security":null,"support":null}},"created_at":"2016-01-18T13:23:05.000Z","updated_at":"2024-03-25T02:03:45.000Z","dependencies_parsed_at":"2022-08-06T14:01:12.220Z","dependency_job_id":null,"html_url":"https://github.com/envygeeks/pathutil","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/envygeeks/pathutil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envygeeks%2Fpathutil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envygeeks%2Fpathutil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envygeeks%2Fpathutil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envygeeks%2Fpathutil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/envygeeks","download_url":"https://codeload.github.com/envygeeks/pathutil/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envygeeks%2Fpathutil/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260257619,"owners_count":22982017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pathname","pathutil","ruby","stdlib-replacement","stdout"],"created_at":"2024-11-15T16:06:58.219Z","updated_at":"2025-06-20T17:06:34.147Z","avatar_url":"https://github.com/envygeeks.png","language":"Ruby","readme":"\u003cp align=center\u003e\n  \u003ca href=https://goo.gl/BhrgjW\u003e\n    \u003cimg src=https://envygeeks.io/badges/paypal-large_1.png alt=Donate\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=https://travis-ci.org/envygeeks/pathutil\u003e\n    \u003cimg src=\"https://travis-ci.org/envygeeks/pathutil.svg?branch=master\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n# Pathutil\n\nPathutil tries to be a faster pure Ruby impelementation of Pathname.  It\narose out of a need to fix basic problems with Pathname, such as suscepetibility\nto join overrides, need for automatic encoding, and normalization (for stuff\nlike Jekyll) and the ability to do other safe-style operations in an\nencapsulated format, like copying files and folders with symlinks\nbut only if they originate from the given root.\n\n### Diverging (or New/Extra) Methods\n\n- `encoding`, `encoding=` - Set the read/write encoding.\n- `normalize` - `crlf` =\u003e `lf` (read), `lf` =\u003e `crlf` (write).\n- `!~`, `=~` - Regexp operations on the path, behaves normally.\n- `search_backwards` - Allows you to search backwards for a file or folder.\n- `\u003e=`, `\u003e` - Check if a file is in but ahead of a path: `Pathutil.new(\"/tmp/hello\") \u003e \"/tmp\" # =\u003e true`\n- `in_path?` - Check if a file is within a given path: `Pathutil.new(\"/tmp/hello\").in_path?(\"/tmp\") # =\u003e true`\n- `\u003c=`, `\u003c` - Check if a file is in but below a path: `Pathutil.new(\"/tmp\") \u003c \"/tmp/hello\" # =\u003e true`\n- `read_yaml` - a wrapper around `Yaml.safe_load` and `SafeYAML` to make reading `YAML` easy.\n- `children` - behaves like Pathname, except it accepts a block to work on the path.\n- `safe_copy` - Copy files, disallowing symlinks unless `in_path?`\n- `enforce_root` - Force a root if not already in that root.\n- `read_yaml` - Read YAML with or without safe.\n- `unlink` - Behaves like File.\n\n`touch`, `rm_r`, `link`, `symlink`, `cp_r`, `rm`, `cp`, `rm_rf`, `first` (alias of `dirname`), `shellescape`, `to_regexp`, `chdir`, `glob` (does `chdir` first), `gsub` (works on `@path`), `chomp` (works on `@path`), `mkdir_p`, `to_str` (alias of `to_s`), `to_a` (alias of `children`), `regexp_escape`, `last` (alias of `basename`), `to_pathname`, `split_path`, `read_json`, `rm_f`\n\n## Current (All) Methods\n\nPathutil has and responds to all methods that Pathname provides and forwards\nthem where they need to go with wrappers if necessary and with our `@path` as\nthe first argumement on our behalf.  It is a true encapsulator with a few\nextra helpers to make your life easy.\n\n`relative_path_from`, `touch`, `mkpath`, `rmtree`, `rm_r`, `sub_ext`, `directory?`, `exist?`, `opendir`, `readable?`, `readable_real?`, `world_readable?`, `writable?`, `writable_real?`, `world_writable?`, `executable?`, `executable_real?`, `file?`, `size?`, `owned?`, `grpowned?`, `pipe?`, `symlink?`, `socket?`, `blockdev?`, `chardev?`, `setuid?`, `setgid?`, `sticky?`, `stat`, `lstat`, `ftype`, `atime`, `mtime`, `ctime`, `birthtime`, `utime`, `chmod`, `chown`, `lchmod`, `lchown`, `link`, `symlink`, `readlink`, `truncate`, `rename`, `find`, `unlink`, `expand_path`, `normalize`, `realpath`, `\u003c`, `basename`, `\u003e`, `realdirpath`, `extname`, `dirname`, `cp_r`, `rm`, `zero?`, `make_link`, `cp`, `rm_rf`, `entries`, `/`, `+`, `make_symlink`, `first`, `to_path`, `each_entry`, `shellescape`, `to_regexp`, `chdir`, `mkdir`, `rmdir`, `glob`, `fnmatch?`, `\u003c=`, `\u003e=`, `fnmatch`, `split`, `read`, `write`, `sub`, `gsub`, `chomp`, `mkdir_p`, `open`, `readlines`, `delete`, `size`, `each_line`, `sysopen`, `encoding`, `binwrite`, `binread`, `to_str`, `to_a`, `split_path`, `to_pathname`, `read_yaml`, `read_json`, `in_path?`, `regexp_escape`, `enforce_root`, `parent`, `safe_copy`, `root?`, `absolute?`, `relative?`, `each_filename`, `descend`, `last`, `ascend`, `join`, `encoding=`, `mountpoint?`, `children`, `each_child`, `rm_f`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvygeeks%2Fpathutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenvygeeks%2Fpathutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvygeeks%2Fpathutil/lists"}