{"id":15032752,"url":"https://github.com/ruby/gdbm","last_synced_at":"2025-10-19T22:32:06.705Z","repository":{"id":19915702,"uuid":"88256960","full_name":"ruby/gdbm","owner":"ruby","description":"Ruby extension for GNU dbm.","archived":false,"fork":false,"pushed_at":"2025-07-21T19:12:16.000Z","size":188,"stargazers_count":16,"open_issues_count":0,"forks_count":12,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-07-21T21:28:57.418Z","etag":null,"topics":["gdbm","ruby"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","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":"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,"zenodo":null}},"created_at":"2017-04-14T10:05:03.000Z","updated_at":"2025-07-21T19:12:19.000Z","dependencies_parsed_at":"2024-03-04T08:27:49.920Z","dependency_job_id":"b5f05093-a47d-434f-a110-33fc1a98b72e","html_url":"https://github.com/ruby/gdbm","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ruby/gdbm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgdbm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgdbm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgdbm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgdbm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruby","download_url":"https://codeload.github.com/ruby/gdbm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgdbm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279927568,"owners_count":26245503,"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","status":"online","status_checked_at":"2025-10-19T02:00:07.647Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["gdbm","ruby"],"created_at":"2024-09-24T20:19:22.033Z","updated_at":"2025-10-19T22:32:06.700Z","avatar_url":"https://github.com/ruby.png","language":"C","readme":"# GDBM\n\nGNU dbm is a library for simple databases. A database is a file that stores\nkey-value pairs. Gdbm allows the user to store, retrieve, and delete data by\nkey. It furthermore allows a non-sorted traversal of all key-value pairs.\nA gdbm database thus provides the same functionality as a hash. As\nwith objects of the Hash class, elements can be accessed with \u003ctt\u003e[]\u003c/tt\u003e.\nFurthermore, GDBM mixes in the Enumerable module, thus providing convenient\nmethods such as #find, #collect, #map, etc.\n\nA process is allowed to open several different databases at the same time.\nA process can open a database as a \"reader\" or a \"writer\". Whereas a reader\nhas only read-access to the database, a writer has read- and write-access.\nA database can be accessed either by any number of readers or by exactly one\nwriter at the same time.\n\n## Installing the required libraries.\n\n### On Debian/Ubuntu\n\n```\nsudo apt install libgdbm-dev\n```\n\n### On Redhat/Fedora\n\n```\nsudo dnf install gdbm-devel\n```\n\nor if you are using an older version of Redhat or Fedora that uses Yum:\n\n```\nsudo yum install gdbm-devel\n```\n\n### On macOS\n\nIf you are using Homebrew, you can install gdbm with the following command:\n\n```\nbrew install gdbm\n```\n\nor if you are using MacPorts, you can install gdbm with:\n\n```\nsudo port install gdbm\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'gdbm'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install gdbm\n\n\n### Install on macOS with gdbm path.\n\n```\ngem install gdbm -- --with-gdbm-dir=$(brew --prefix gdbm)\n```\n\n## Usage\n\n\n1. Opening/creating a database, and filling it with some entries:\nrequire 'gdbm'\n\n```ruby\ngdbm = GDBM.new(\"fruitstore.db\")\ngdbm[\"ananas\"]    = \"3\"\ngdbm[\"banana\"]    = \"8\"\ngdbm[\"cranberry\"] = \"4909\"\ngdbm.close\n```\n\n2. Reading out a database:\n\n```ruby\nrequire 'gdbm'\n\ngdbm = GDBM.new(\"fruitstore.db\")\ngdbm.each_pair do |key, value|\n  print \"#{key}: #{value}\\n\"\nend\ngdbm.close\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/ruby/gdbm.\n\n\n## License\n\nThe gem is available as open source under the terms of the [2-Clause BSD License](https://opensource.org/licenses/BSD-2-Clause).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fgdbm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruby%2Fgdbm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fgdbm/lists"}