{"id":26514545,"url":"https://github.com/fylmtm/dr-types","last_synced_at":"2025-10-11T14:16:34.941Z","repository":{"id":282396579,"uuid":"948454016","full_name":"FylmTM/dr-types","owner":"FylmTM","description":"Ruby types for DragonRuby Gaming Toolkit ","archived":false,"fork":false,"pushed_at":"2025-09-14T19:43:03.000Z","size":1219,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-14T21:31:36.532Z","etag":null,"topics":["dragonruby","gamedev","ruby"],"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/FylmTM.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-14T11:14:57.000Z","updated_at":"2025-09-14T19:43:08.000Z","dependencies_parsed_at":"2025-09-20T12:45:16.841Z","dependency_job_id":null,"html_url":"https://github.com/FylmTM/dr-types","commit_stats":null,"previous_names":["fylmtm/dr-types"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FylmTM/dr-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FylmTM%2Fdr-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FylmTM%2Fdr-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FylmTM%2Fdr-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FylmTM%2Fdr-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FylmTM","download_url":"https://codeload.github.com/FylmTM/dr-types/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FylmTM%2Fdr-types/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007503,"owners_count":26084313,"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-11T02:00:06.511Z","response_time":55,"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":["dragonruby","gamedev","ruby"],"created_at":"2025-03-21T05:18:27.046Z","updated_at":"2025-10-11T14:16:32.913Z","avatar_url":"https://github.com/FylmTM.png","language":"Ruby","readme":"# DragonRuby RBS types\n\nThis project aims to provide great development experience in RubyMine\nfor [DragonRuby Game Toolkit](https://dragonruby.org/).\n\n* RBS type definitions for DragonRuby\n* Ruby shims, with documentation\n* Helpers to avoid some of the shortcoming of RBS support in RubyMine around hashes\n\nIf this works in other editors/IDE, this is purely coincidental, but very nice!\n\n**Important:** consider this project experimental (and containing bugs) until it will be battle tested in real life.\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cimg src=\"docs/autocomplete.png\"  alt=\"autocomplete\"\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cimg src=\"docs/params_hint.png\"  alt=\"params hint\"\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cimg src=\"docs/documentation.png\"  alt=\"type checking\"\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cimg src=\"docs/type_checking.png\"  alt=\"type checking\"\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## Usage\n\nAdd types as a Git submodule somewhere to your project files:\n\n```shell\ngit submodule add https://github.com/FylmTM/dr-types.git dr-types\n```\n\nRubyMine should automatically pick up types.\n\n**Important #1:** Do not add submodule to `mygame/` directory, otherwise this will lead to types being included in final build.\n\n**Important #2:** Make sure to mark `docs` and `samples` from DragonRuby as excluded sources in RubyMine.\nOtherwise, source that is shipped with DragonRuby itself will conflict with Ruby shims in this project.\n\n**Update:**\n\n```shell\ngit submodule update --remote dr-types\n```\n\n### Main\n\nAdd `@param args [GTK::Args]` YARD annotation to your top-level lifecycle functions.\n\n```ruby\n# @param args [GTK::Args]\ndef tick(args) end\n\n# @param args [GTK::Args]\ndef boot(args) end\n\n# @param args [GTK::Args]\ndef reset(args) end\n\n# @param args [GTK::Args]\ndef shutdown(args) end\n```\n\n### State\n\nWant to get types for your object in state?\u003cbr\u003e\nCreate `mygame/app/state.rb`\n\n```\nmodule GTK\n  module State\n    # @return [Player]\n    attr_accessor :player\n  end\nend\n\nclass Player\n  # @return [Integer]\n  attr_accessor :x\n  # @return [Integer]\n  attr_accessor :y\nend\n```\n\n\n### Helpers\n\nWant IDE assist when creating objects for `args.outputs.*`? You can use helpers.\u003cbr\u003e\nCopy `dr-types/helpers` directory into your game folder, e.g. `mygame/lib/helpers`.\n\n```ruby\nrequire \"lib/helpers/helpers.rb\"\n\nargs.outputs.solids \u003c\u003c GTK.solid(x: 100, y: 100, w: 100, h: 100, r: 255, g: 0, b: 0)\nargs.outputs.labels \u003c\u003c GTK.label(x: 50, y: 50, text: \"Hello, world!\")\nargs.outputs.borders \u003c\u003c GTK.border(x: 150, y: 150, w: 20, h: 20, r: 0, g: 255, b: 0)\nargs.outputs.lines \u003c\u003c GTK.line(x: 150, y: 150, x2: 300, y2: 300, r: 0, g: 0, b: 255)\nargs.outputs.sprites \u003c\u003c GTK.sprite(x: 250, y: 250, w: 100, h: 100, path: \"dragonruby.png\")\nargs.outputs.sprites \u003c\u003c GTK.sprite_triangle(x: 20, y: 20, x2: 60, y2: 20, x3: 40, y3: 60, path: \"dragonruby.png\")\nargs.outputs.debug \u003c\u003c GTK.solid_primitive(x: 400, y: 400, w: 100, h: 100, r: 255, g: 0, b: 0)\nargs.outputs.debug \u003c\u003c GTK.border_primitive(x: 600, y: 600, w: 100, h: 100, r: 255, g: 0, b: 0)\nargs.audio[:note] = GTK.sound(input: \"sounds/A3.wav\", x: 1, y: 1, z: 1)\n```\n\n## Background\n\nCreation process looked roughly like this:\n\n1. Initial stubs were generated with `rbs prototype` from `docs/oss`\n2. Then they were heavily processed by LLM (Claude 3.7), to do a first pass (cross-referencing docs \u0026 code)\n3. Then they were heavily manually tweaked by me, to make types sensible\n4. Then I went through documentation fully, making sure that nothing is missing\n5. Then LLM was used to generate Ruby shims from RBS types\n6. Then LLM was used to add YARD documentation to generated Ruby shims\n7. And one final review of generated Ruby code \u0026 documentation.\n8. Write helpers to help with workflow\n\nTypes here might have functionality that is not documented explicitly, but was rather deduced based on\nOSS code \u0026 samples.\n\nThanks to [owenbutler/dragonruby-yard-doc](https://github.com/owenbutler/dragonruby-yard-doc) for giving me hope.\n\n## TODO\n\n- [ ] Improve: Outputs::[] (render targets)\n- [ ] Improve: Outputs::screenshots\n- [ ] Improve: Outputs::shaders\n- [ ] Support: Layout::rect_group\n- [ ] Support: Layout::point\n- [ ] Support: macro - attr_sprite\n- [ ] Support: macro - attr_gtk\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffylmtm%2Fdr-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffylmtm%2Fdr-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffylmtm%2Fdr-types/lists"}