{"id":13720912,"url":"https://github.com/acidtib/deta-ruby","last_synced_at":"2026-02-05T07:34:11.871Z","repository":{"id":59152860,"uuid":"453330277","full_name":"acidtib/deta-ruby","owner":"acidtib","description":"Ruby bindings for deta.sh","archived":false,"fork":false,"pushed_at":"2022-01-30T07:10:36.000Z","size":25,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-23T22:36:20.655Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/acidtib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-29T07:40:30.000Z","updated_at":"2024-01-27T04:59:04.000Z","dependencies_parsed_at":"2022-09-13T11:00:57.317Z","dependency_job_id":null,"html_url":"https://github.com/acidtib/deta-ruby","commit_stats":null,"previous_names":["arubinofaux/deta-ruby"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/acidtib/deta-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acidtib%2Fdeta-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acidtib%2Fdeta-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acidtib%2Fdeta-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acidtib%2Fdeta-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acidtib","download_url":"https://codeload.github.com/acidtib/deta-ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acidtib%2Fdeta-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29115612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T05:31:32.482Z","status":"ssl_error","status_checked_at":"2026-02-05T05:31:29.075Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-08-03T01:01:09.801Z","updated_at":"2026-02-05T07:34:11.854Z","avatar_url":"https://github.com/acidtib.png","language":"Ruby","readme":"# Deta-Ruby\n[![Gem Version](https://badge.fury.io/rb/deta.svg)](https://badge.fury.io/rb/deta)\n\ndeta-ruby is an unofficial Deta Gem for Ruby\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'deta'\n```\n\nor grab it from Github\n```ruby\ngem 'deta', github: \"arubinofaux/deta-ruby\"\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install deta\n\n## Usage\n\nTo access the API, you'll need to create a `Deta::Client` and pass in your project key. You can find your project key at [https://web.deta.sh](https://web.deta.sh)\n\n```ruby\nclient = Deta::Client.new(project_key: ENV[\"DETA_PROJECT_KEY\"])\n```\n\nThe client then gives you access to each of the resources.\n\nResponses are created as objects like `Deta::BaseObject`. Having types like `Deta::DriveObject` is handy for understanding what type of object you're working with. They're built using OpenStruct so you can easily access data in a Ruby-ish way.\n\n## Base\n\n```ruby\ndetabase = client.base(\"base_name\")\n```\n\n### Put Items\n\n```ruby\n# single item\nput = detabase.put({name: \"Mike Jones\", age: 31, hometown: \"Denver\"})\nput.processed.items.first.key\n\n# multi items\nputs = detabase.put([{name: \"Mike Jones\", age: 31, hometown: \"Denver\"}, {name: \"Mike Dow\", age: 25, hometown: \"Miami\"}])\nputs.processed\n```\n\n### Get Item\n\n```ruby\ndetabase.get(key)\n```\n\n### Delete Item\n\n```ruby\ndetabase.delete(key)\n```\n\n### Insert Item\n\n```ruby\ndetabase.insert(name: \"Mike Jones\", age: 31, hometown: \"Denver\")\n\n# specify the key\ndetabase.insert(key: \"ab5tsstc9bh8\", name: \"Mike Jones\", age: 31, hometown: \"Denver\")\n```\n\n### Update Item\n\n```ruby\ndetabase.update(key, set: {hometown: \"Miami\"})\n```\n\n### Query Items\n\n```ruby\ndetabase.fetch(query: {hometown: \"Denver\"})\ndetabase.fetch(query: [{hometown: \"Boulder\"}, {\"age?lt\": 33}])\n\ndetabase.fetch(query: [{hometown: \"Boulder\"}], limit: 1, last: \"8523bdyxlqww\")\n```\n\n## Drive\n\n```ruby\ndetadrive = client.drive(\"drive_name\")\n```\n\n### Put File\n\n```ruby\ndetadrive.put(\"test.jpg\", path: \"./test.jpg\", content_type: \"image/jpeg\")\n\ndetadrive.put(\"test.txt\", data: \"hello\")\n\ndetadrive.put(\"test.json\", data: {a: 1}.to_json)\n```\n\n### List Files\n\n```ruby\ndetadrive.list(limit: 1, prefix: \"avatar\")\n```\n\n### Get File\n\n```ruby\ndetadrive.get(\"image0.jpg\")\n```\n\n### Delete Files\n\n```ruby\n# single delete\ndetadrive.delete(\"image0.jpg\")\n\n# multi delete\ndetadrive.delete([\"image1.jpg\", \"image2.jpg\"])\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. 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 the created tag, 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/arubinofaux/deta-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/arubinofaux/deta-ruby/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Deta project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/arubinofaux/deta-ruby/blob/main/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":["SDK's"],"sub_categories":["Ruby SDK"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facidtib%2Fdeta-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facidtib%2Fdeta-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facidtib%2Fdeta-ruby/lists"}