{"id":26046818,"url":"https://github.com/unagisoftware/ruber","last_synced_at":"2025-03-07T21:48:47.313Z","repository":{"id":280027939,"uuid":"926585959","full_name":"unagisoftware/ruber","owner":"unagisoftware","description":"Ruby SDK for Uber API","archived":false,"fork":false,"pushed_at":"2025-02-28T20:16:21.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T23:07:39.491Z","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/unagisoftware.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-03T14:18:48.000Z","updated_at":"2025-02-28T20:16:24.000Z","dependencies_parsed_at":"2025-02-28T23:07:52.328Z","dependency_job_id":"2c5e0fb4-4230-4d14-9214-ff5baee3bfe3","html_url":"https://github.com/unagisoftware/ruber","commit_stats":null,"previous_names":["unagisoftware/ruber"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unagisoftware%2Fruber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unagisoftware%2Fruber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unagisoftware%2Fruber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unagisoftware%2Fruber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unagisoftware","download_url":"https://codeload.github.com/unagisoftware/ruber/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242467569,"owners_count":20133114,"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":[],"created_at":"2025-03-07T21:48:46.838Z","updated_at":"2025-03-07T21:48:47.298Z","avatar_url":"https://github.com/unagisoftware.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruber\n\nThe easiest way to integrate to Uber API.\n\n\u003e The current version includes the integration with the Uber Direct API.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```\ngem 'ruber', github: \"unagisoftware/ruber\"\n```\n\nAnd then execute:\n\n```\n$ bundle\n```\n## Configuration\nRuber can be customized using various configuration options. To see the full list, run the `init` generator to create an initializer with all the options. Then, uncomment the variables you want to customize.\n\n```bash\nrails generate ruber:init\n# This will create a file ruber.rb under config/initializers\n```\n\n## Usage\n\nTo access the API, you'll need to create an account on Uber (see the [Uber developers website](https://developer.uber.com) for more information). Once you have your account, go to the developer options to find your `customer_id`, `client_id`, and `client_secret`.\n\nYou need to pass those values to the gem. You can do this from anywhere, but we recommend using an initializer like this:\n\n```ruby\nRuber.configure do |config|\n  config.customer_id = 'uber-customer-id'\n  config.client_id = 'uber-client-id'\n  config.client_secret = 'uber-client-secret'\nend\n```\n\n_ℹ️ If you run the `init` generator you should set the attributes in the generated initializer (`config/initializers/ruber`)_\n\n## Cache\nRuber uses a caching solution to improve efficiency (e.g., for caching tokens). By default, it uses a simple file cache (see below), but you can change the cache method by setting the `Ruber.cache` attribute:\n\n```ruby\nRuber.cache = Redis.new\n# or\nRuber.cache = Rails.cache\n# or any object that responds to read/write/delete/clear\nRuber.cache = YourCustomCache.new\n```\n\n### File cache\n\nFile cache is the default cache option. It uses a yaml file to store the cached data.\n\n```yml\n---\n# Example of file automatically generated\n:access_token:\n  :token: IA.VUNmGAAAAAAAEgASAAAABwAIAAwAAAAAAAAAEgAAAAAAAAGwAAAAFAAAAAAADgAQAAQAAAAIAAwAAAAOAAAAhAAAABwAAAAEAAAAEAAAAKbivxMQNu9xZfQn_LJeh75fAAAAcqjQlrRGJjknFRPDLARG0Uj0kIvmkIh7cy_HI8cPjKMP4ja0xAvKLSJ1H9eU1ALQJkExzcMwvMkPyVjpSm-c4Wk1S__oSOK_pkAX1kywZr8sBpP_gtPwBhrz3SF8L6YADAAAALkCO6lUHox2Dp907iQAAABiMGQ4NTgwMy0zOGEwLTQyYjMtODA2ZS03YTRjZjhlMTk2ZWU\n  :expires_at: 2025-03-27 16:46:12.256308000 -03:00\n```\n\nIn case you want to go for this option, you'll need to set the `file_cache_path` attribute to determine where to save the file.\n\n‼️ **Make sure that this path is in your `.gitignore` to avoid pushing your token to the repo.**\n\n## Resources\n\nRuber maps resources from the Uber API to internal resources. For example, `Ruber::DeliveryResource` lets you create, find, list, cancel, and manage deliveries in Uber. When you call these methods on a resource, it returns objects created using [Data Define](https://docs.ruby-lang.org/en/3.2/Data.html), allowing you to access data in a Ruby-like way.\n\n```ruby\ndelivery = Ruber::DeliveryResource.find(\"del_id1231asdfas\")\n#=\u003e Ruber::Delivery\ndelivery.id\n#=\u003e del_id1231asdfas\n```\n\n### DeliveryResource\n\n```ruby\nRuber::DeliveryResource.all\n#=\u003e Ruber::Collection of Ruber::Delivery\n\nRuber::DeliveryResource.find(\"del_id\")\n#=\u003e Ruber::Delivery\n\nRuber::DeliveryResource.create({...}}\n#=\u003e Ruber::Delivery\n\nRuber::DeliveryResource.cancel(\"del_id\")\n#=\u003e Ruber::Delivery\n\nRuber::DeliveryResource.update(\"del_id\", {...})\n#=\u003e Ruber::Delivery\n\nRuber::DeliveryResource.proof_of_delivery(\"del_id\", {...})\n#=\u003e Ruber::Delivery::ProofOfDelivery\n```\n\n## Authentication\nTo access the Uber API, you need a valid access token from Uber's OAuth service. All requests to https://api.uber.com/ use OAuth 2.0 with the client_credentials grant type.\n\nAuthentication and caching are handled automatically by the gem. The only thing you need to do is provide the required credentials (`customer_id`, `client_id`, and `client_secret`).\n\n## Errors\nIf the Uber API returns an error, a `Ruber::Error` exception is raised. Ruber::Error provides the following accessors: `message`, `metadata`, `status`:\n\n```ruby\nbegin\n  Ruber::DeliveryResource.create(...)\nrescue Ruber::Error =\u003e error\n  puts error.message # \"The pickup address is invalid\"\n  puts error.metadata # { \"pickup_address\": \"123 Fake Street, Nowhere\" }\n  puts error.status # 400\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to 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 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/unagisoftware/ruber. 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/unagisoftware/ruber/blob/master/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 Ruber project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/unagisoftware/ruber/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funagisoftware%2Fruber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funagisoftware%2Fruber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funagisoftware%2Fruber/lists"}