{"id":25018091,"url":"https://github.com/git-gyoza/gyoza-languages","last_synced_at":"2026-02-17T22:02:38.329Z","repository":{"id":273281363,"uuid":"919093343","full_name":"git-gyoza/gyoza-languages","owner":"git-gyoza","description":"A Ruby implementation of the Github linguist project with an integrated simple HTTP web server","archived":false,"fork":false,"pushed_at":"2025-01-22T17:08:46.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-29T20:54:21.632Z","etag":null,"topics":["gem","github-actions","github-linguist","puma","rack","rake","rspec","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/git-gyoza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-01-19T17:31:57.000Z","updated_at":"2025-01-22T17:08:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"a5548c7c-c171-4964-80de-cc86191a6b3a","html_url":"https://github.com/git-gyoza/gyoza-languages","commit_stats":null,"previous_names":["git-gyoza/gyoza-languages"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/git-gyoza/gyoza-languages","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-gyoza%2Fgyoza-languages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-gyoza%2Fgyoza-languages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-gyoza%2Fgyoza-languages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-gyoza%2Fgyoza-languages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/git-gyoza","download_url":"https://codeload.github.com/git-gyoza/gyoza-languages/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-gyoza%2Fgyoza-languages/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29559961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T21:50:49.831Z","status":"ssl_error","status_checked_at":"2026-02-17T21:46:15.313Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["gem","github-actions","github-linguist","puma","rack","rake","rspec","ruby"],"created_at":"2025-02-05T10:27:43.905Z","updated_at":"2026-02-17T22:02:38.312Z","avatar_url":"https://github.com/git-gyoza.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/gem/v/gyoza-languages?color=aa0000\" alt=\"\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/git-gyoza/gyoza-languages/gem-push.yml?label=tests\" alt=\"\"\u003e\n\u003c/p\u003e\n\n**gyoza-languages** is a simple interface that combines the \nspeed of [GitHub Linguist](https://github.com/github-linguist/linguist)\nwith the highly efficient Ruby web server [Puma](https://github.com/puma/puma).\n\nIt allows to query an **HTTP Rest API** to retrieve the languages data from one\nor many repositories in a **JSON** format.\n\n| Table of Contents |\n|-------------------|\n| [Usage](#usage)   |\n| [API](#api)       |\n\n# Usage \n\nThe application requires only a few arguments, but they are essential \nfor its correct functioning.\n\n```\nA Ruby implementation of the Github linguist project with an integrated simple HTTP web server.\n\nUsage: gyoza-languages [options]\n\n    -p, --port PORT                 Starts the server with the specified port (2015 by default).\n    -d, --directory DIRECTORY       Manually specifies the repositories directory.\n    -h, --help                      Show this message\n\nIf the -d argument is not specified, a REPOSITORIES_DIRECTORY environment variable will be necessary.\n```\n\nSpecifying a port is optional as the default value is `2015`.\n\nThe most important (and mandatory) parameter is the `--directory`:\nthis represents the directory where all the repositories are stored.\nDefining a correct directory is crucial for **managing** the web server **endpoints**.\n\nYou can set one by either creating an **environment variable** with name\n**REPOSITORIES_DIRECTORY** or by directly specifying it using **--directory** (or **-d**).\n\nLet's assume that the folder structure you choose looks like this:\n\n```python\nrepositories_directory:\n    images:\n        # a bunch of images\n    gyoza-languages:\n        # a clone of this repository\n    my_repositories:\n        super_awesome_repo:\n            # another Git repository \n```\n\nThis means that all the directories in the folder will become endpoints,\nbut only a few will be valid:\n\n- `/images` will answer with **404 Not Found**, as it is not a **valid repository**;\n- `/gyoza-languages` is a valid repository and will return the correct answer;\n- `/my_repositories` is **NOT** a valid repository, even though it contains other repositories.\n  As such, it will answer with **404 Not Found**;\n- `/my_repositories/super_awesome_repo` is a valid repository.\n\nAlong with that, the query parameter `branch` is also available,\nmeaning that it is possible to obtain the languages count from another branch.\nAn example is: `/myrepositories/super_awesome_repo?branch=dev` (if not existing, a **404 Not found**\nmessage will be returned).\n\n# API\n\n**gyoza-languages** also provides an **API** for general purposes and one to interact with\nthe server started by the application itself.\n\nAfter importing the module using `require 'gyoza-languages'`, two core classes are available:\n\n- [GyozaApp](../main/lib/gyoza-languages/gyoza_app.rb).\n  This class offers five different methods that correspond to the **HTTP request methods**:\n  \n  - `get(path, query, env)`;\n  - `post(path, query, env)`;\n  - `put(path, query, env)`;\n  - `patch(path, query, env)`;\n  - `delete(path, query, env)`.\n  \n  By overriding these methods, it is possible to implement custom responses for each one\n  of the requests. The arguments passed are:\n\n  - `path`: the corresponding path in a string format;\n  - `query`: a hash that corresponds to the queried parameters;\n  - `env`: a hash comprehending all the current environment variables and more data.\n  \n  If the **HTTP method** is not among the listed above, by overriding the `call(env)`\n  function it is possible to access directly to the core responding function, and\n  retrieve the method with `env[REQUEST_METHOD]`;\n\n- [GyozaLanguageApp](../main/lib/gyoza-languages/gyoza_language_app.rb).\n  This class is the heart of the application. It extends\n  [GyozaApp](../main/lib/gyoza-languages/gyoza_app.rb) to provide support for\n  [GitHub Linguist](https://github.com/github-linguist/linguist) when a \n  **GET request** is done to the server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-gyoza%2Fgyoza-languages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgit-gyoza%2Fgyoza-languages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-gyoza%2Fgyoza-languages/lists"}