{"id":15032755,"url":"https://github.com/ruby/pathname","last_synced_at":"2025-05-15T23:08:50.421Z","repository":{"id":41973391,"uuid":"266092160","full_name":"ruby/pathname","owner":"ruby","description":"Pathname represents the name of a file or directory on the filesystem, but not the file itself.","archived":false,"fork":false,"pushed_at":"2025-05-01T05:32:33.000Z","size":444,"stargazers_count":27,"open_issues_count":12,"forks_count":17,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-05-01T06:28:34.554Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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,"zenodo":null}},"created_at":"2020-05-22T11:18:25.000Z","updated_at":"2025-05-01T05:32:35.000Z","dependencies_parsed_at":"2023-01-24T03:45:44.296Z","dependency_job_id":"df449838-df24-48eb-b64d-b9504db4013b","html_url":"https://github.com/ruby/pathname","commit_stats":{"total_commits":276,"total_committers":41,"mean_commits":"6.7317073170731705","dds":0.5615942028985508,"last_synced_commit":"9d0190017f1ade0850bb6c47d8cf0c4165ea1dc0"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fpathname","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fpathname/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fpathname/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fpathname/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruby","download_url":"https://codeload.github.com/ruby/pathname/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436949,"owners_count":22070947,"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":["ruby"],"created_at":"2024-09-24T20:19:22.635Z","updated_at":"2025-05-15T23:08:44.385Z","avatar_url":"https://github.com/ruby.png","language":"Ruby","readme":"# Pathname\n\nPathname represents the name of a file or directory on the filesystem,\nbut not the file itself.\n\nThe pathname depends on the Operating System: Unix, Windows, etc.\nThis library works with pathnames of local OS, however non-Unix pathnames\nare supported experimentally.\n\nA Pathname can be relative or absolute.  It's not until you try to\nreference the file that it even matters whether the file exists or not.\n\nPathname is immutable.  It has no method for destructive update.\n\nThe goal of this class is to manipulate file path information in a neater\nway than standard Ruby provides.  The examples below demonstrate the\ndifference.\n\n*All* functionality from File, FileTest, and some from Dir and FileUtils is\nincluded, in an unsurprising way.  It is essentially a facade for all of\nthese, and more.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'pathname'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install pathname\n\n## Usage\n\n```ruby\nrequire 'pathname'\npn = Pathname.new(\"/usr/bin/ruby\")\nsize = pn.size              # 27662\nisdir = pn.directory?       # false\ndir  = pn.dirname           # Pathname:/usr/bin\nbase = pn.basename          # Pathname:ruby\ndir, base = pn.split        # [Pathname:/usr/bin, Pathname:ruby]\ndata = pn.read\npn.open { |f| _ }\npn.each_line { |line| _ }\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake` to compile this and run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/ruby/pathname.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fpathname","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruby%2Fpathname","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fpathname/lists"}