{"id":17200509,"url":"https://github.com/toy/fspath","last_synced_at":"2025-04-13T19:31:24.491Z","repository":{"id":1211346,"uuid":"1125766","full_name":"toy/fspath","owner":"toy","description":"Better than Pathname","archived":false,"fork":false,"pushed_at":"2025-02-26T16:50:01.000Z","size":145,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-11T13:10:28.346Z","etag":null,"topics":["filepath-manipulation","pathname","ruby"],"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/toy.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-11-30T15:49:51.000Z","updated_at":"2025-02-26T16:50:05.000Z","dependencies_parsed_at":"2024-01-13T12:31:14.920Z","dependency_job_id":"5d249cda-9680-4608-ab3f-1d0049d99e08","html_url":"https://github.com/toy/fspath","commit_stats":{"total_commits":268,"total_committers":2,"mean_commits":134.0,"dds":"0.23880597014925375","last_synced_commit":"1cf0a7501a18e87ed779763a92bb17b5b4d5f9cb"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toy%2Ffspath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toy%2Ffspath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toy%2Ffspath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toy%2Ffspath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toy","download_url":"https://codeload.github.com/toy/fspath/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248767898,"owners_count":21158555,"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":["filepath-manipulation","pathname","ruby"],"created_at":"2024-10-15T02:08:54.554Z","updated_at":"2025-04-13T19:31:24.483Z","avatar_url":"https://github.com/toy.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://img.shields.io/gem/v/fspath?logo=rubygems)](https://rubygems.org/gems/fspath)\n[![Check](https://img.shields.io/github/actions/workflow/status/toy/fspath/check.yml?label=check\u0026logo=github)](https://github.com/toy/fspath/actions/workflows/check.yml)\n[![Rubocop](https://img.shields.io/github/actions/workflow/status/toy/fspath/rubocop.yml?label=rubocop\u0026logo=rubocop)](https://github.com/toy/fspath/actions/workflows/rubocop.yml)\n[![Code Climate](https://img.shields.io/codeclimate/maintainability/toy/fspath?logo=codeclimate)](https://codeclimate.com/github/toy/fspath)\n[![Depfu](https://img.shields.io/depfu/toy/fspath)](https://depfu.com/github/toy/fspath)\n[![Inch CI](https://inch-ci.org/github/toy/fspath.svg?branch=master)](https://inch-ci.org/github/toy/fspath)\n\n# fspath\n\nBetter than Pathname\n\nCheck out [fspath-mac](https://rubygems.org/gems/fspath-mac) and [fspath-xattr](https://rubygems.org/gems/fspath-xattr).\n\n## Synopsis\n\nUser dir:\n\n    FSPath.~\n\nOther user dir:\n\n    FSPath.~('other')\n\nCommon dir for paths:\n\n    FSPath.common_dir('/a/b/c/d/e/f', '/a/b/c/1/hello', '/a/b/c/2/world') # =\u003e FSPath('/a/b/c')\n\nTemp file (args are passed to `Tempfile.new`):\n\n    FSPath.temp_file{ |f| …; p f.path; … }\n\n    f = FSPath.temp_file\n    …\n    f.close\n\nTemp file path (args are passed to `Tempfile.new`):\n\n    FSPath.temp_file_path{ |path| …; p path; … }\n\n    path = FSPath.temp_file_path\n    …\n    # file will be removed on next GC run if reference to path is lost\n\nTemp directory (args are passed to `Dir.mktmpdir`):\n\n    FSPath.temp_dir{ |dir| …; p dir; …  }\n\n    dir = FSPath.temp_dir\n    …\n    # the dir is not removed when temp_dir is run without block\n\nJoin paths:\n\n    FSPath('a') / 'b' / 'c' # =\u003e FSPath('a/b/c')\n\nRead/write:\n\n    FSPath('a.txt').read\n    FSPath('b.bin').binread\n    FSPath('a.txt').write(text)\n    FSPath('b.bin').binwrite(data)\n    FSPath('a.txt').append(more_text)\n    FSPath('b.bin').binappend(more_data)\n\nEscape glob:\n\n    FSPath('trash?/stuff [a,b,c]').escape_glob # =\u003e FSPath('trash\\?/stuff \\[a,b,c\\]')\n\nExpand glob:\n\n    FSPath('trash').glob('**', '*')\n\nAscendants:\n\n    FSPath('a/b/c').ascendants\n    FSPath('a/b/c').ascend # =\u003e [FSPath('a/b/c'), FSPath('a/b'), FSPath('a')]\n\nDescendants:\n\n    FSPath('a/b/c').descendants\n    FSPath('a/b/c').descend # =\u003e [FSPath('a'), FSPath('a/b'), FSPath('a/b/c')]\n\nPath parts:\n\n    FSPath('/a/b/c').parts # =\u003e ['/', 'a', 'b', 'c']\n\nBasename and extension:\n\n    FSPath('some/dir/name.ext').prefix_suffix # =\u003e [FSPath('name'), '.ext']\n\n## Copyright\n\nCopyright (c) 2010-2019 Ivan Kuchin. See LICENSE.txt for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoy%2Ffspath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoy%2Ffspath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoy%2Ffspath/lists"}