{"id":15101472,"url":"https://github.com/kishan-aghera/bowling_game_api","last_synced_at":"2026-02-02T17:07:48.310Z","repository":{"id":232008378,"uuid":"783224341","full_name":"kishan-aghera/bowling_game_api","owner":"kishan-aghera","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-08T11:20:22.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T19:05:38.711Z","etag":null,"topics":["api","rspec","sinatra"],"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/kishan-aghera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-04-07T09:33:57.000Z","updated_at":"2024-04-07T10:25:31.000Z","dependencies_parsed_at":"2024-04-07T11:27:55.178Z","dependency_job_id":"19d2fa69-b953-47a4-8574-c0b48c35d556","html_url":"https://github.com/kishan-aghera/bowling_game_api","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"b4a9690277ba57ca08cb81732d72c23a33de5bf7"},"previous_names":["kishan-aghera/bowling_game_api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kishan-aghera/bowling_game_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kishan-aghera%2Fbowling_game_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kishan-aghera%2Fbowling_game_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kishan-aghera%2Fbowling_game_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kishan-aghera%2Fbowling_game_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kishan-aghera","download_url":"https://codeload.github.com/kishan-aghera/bowling_game_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kishan-aghera%2Fbowling_game_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29015777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T16:17:30.374Z","status":"ssl_error","status_checked_at":"2026-02-02T15:58:50.469Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["api","rspec","sinatra"],"created_at":"2024-09-25T18:23:49.802Z","updated_at":"2026-02-02T17:07:48.283Z","avatar_url":"https://github.com/kishan-aghera.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bowling Game API\n\n## Table Of Contents\n\n* [About the Project](#about-the-project)\n* [Built With](#built-with)\n* [Getting Started](#getting-started)\n  * [Prerequisites](#prerequisites)\n  * [Installation](#installation)\n* [Usage](#usage)\n* [Testing](#testing)\n\n## About The Project\n\nThis repo contains API using which you can calculate score for a bowling game.\n\n## Built With\n\n- Ruby 3.3.0\n- Sinatra for API server\n- Rspec for testing\n\n## Getting Started\n\n### Prerequisites\n\n* ruby (Make sure rbenv is installed. Please refer [rbenv](https://github.com/rbenv/rbenv?tab=readme-ov-file) if not.)\n\n```sh\nrbenv install 3.3.0\n```\n\n### Installation\n\n1. Clone the repo\n\n```sh\ngit clone https://github.com/kishan-aghera/bowling_game_api.git \n```\n\n2. Move into the bowling_game_api directory.\n\n```sh\ncd bowling_game_api\n```\n\n3. Bundle the required gems\n\n```sh\nbundle install\n```\n\n4. Start the sinatra server\n\n```sh\nruby server.rb\n```\n\n## Usage\n\n### Using Postman/Thunder Client:\n\n- There are 3 APIs that are created: \n\n#### POST /start\n\n- This will initialize an object of the BowlingGame class.\n\n#### POST /roll\n\n- This is used to add roll and update the score.\n- We will need to pass `pins` key with the no. of pins fallen as integer like `5`. So, pass parameters in body in JSON format like:\n\n```json\n{\n  \"pins\": 5\n}\n```\n\n- This should give response like shown below.\n\n```json\n{\n  \"message\": \"Roll successful.\",\n  \"current_score\": [\n    {\n      \"rolls\": [\n        5\n      ],\n      \"score\": 5\n    }\n  ],\n  \"total_score\": 5,\n  \"last_frame\": \"none\"\n}\n```\n\n#### GET /current_score\n\n- This will give output something like shown below.\n\n```json\n{\n  \"message\": \"Success\",\n  \"current_score\": 5,\n  \"total_score\": 5,\n  \"last_frame\": \"none\"\n}\n```\n\n###  Using IRB:\n\n1. Run IRB from within the project's directory.\n\n```sh\nirb\n```\n\n2. Require the `bowling_game` rb class.\n\n```ruby\nrequire_relative \"./bowling_game\"\n```\n\n3. Initialize the class.\n\n```ruby\ngame = BowlingGame.new\n```\n4. There are various methods available that you can use. e.g.\n\ni. To roll a pin let's say 5, use \n\n```ruby\ngame.roll(5)\n```\n\nii. To get current score, use\n\n```ruby\ngame.current_score\n```\n\nThis should return\n\n```ruby\n5\n```\n\niii. To get total score, use:\n\n```ruby\ngame.total_score\n```\n\nThis should return\n\n```ruby\n5\n```\n\n## Testing\n\n- Rspec is used for testing this API as well as the class.\n- In order to run all the spec files at once, please run \n\n```sh\nrspec\n```\n\n- In order to run spec file for API, run\n\n```sh\nrspec spec/bowling_api_spec.rb\n```\n\n- In order to run spec file for the Bowling Game class, run\n\n```sh\nrspec spec/bowling_game_spec.rb\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkishan-aghera%2Fbowling_game_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkishan-aghera%2Fbowling_game_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkishan-aghera%2Fbowling_game_api/lists"}