{"id":13877895,"url":"https://github.com/soutaro/rbs-inline","last_synced_at":"2026-02-12T06:23:41.820Z","repository":{"id":232200945,"uuid":"781886508","full_name":"soutaro/rbs-inline","owner":"soutaro","description":"Inline RBS type declaration","archived":false,"fork":false,"pushed_at":"2025-11-24T18:41:03.000Z","size":525,"stargazers_count":327,"open_issues_count":24,"forks_count":21,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-12-04T19:13:24.618Z","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/soutaro.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-04T08:24:47.000Z","updated_at":"2025-12-03T02:19:29.000Z","dependencies_parsed_at":"2024-05-06T19:32:42.830Z","dependency_job_id":"d2b865da-5a51-4e05-b9ca-6c834052d0e7","html_url":"https://github.com/soutaro/rbs-inline","commit_stats":{"total_commits":230,"total_committers":7,"mean_commits":"32.857142857142854","dds":"0.33913043478260874","last_synced_commit":"912160c87bfae522353228aa89820d0fd6a9f0fd"},"previous_names":["soutaro/rbs-inline"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/soutaro/rbs-inline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soutaro%2Frbs-inline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soutaro%2Frbs-inline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soutaro%2Frbs-inline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soutaro%2Frbs-inline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soutaro","download_url":"https://codeload.github.com/soutaro/rbs-inline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soutaro%2Frbs-inline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29359361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","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":[],"created_at":"2024-08-06T08:01:34.314Z","updated_at":"2026-02-12T06:23:41.796Z","avatar_url":"https://github.com/soutaro.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# RBS::Inline\n\nRBS::Inline allows embedding RBS type declarations into Ruby code as comments. You can declare types, write the implementation, and verifies they are consistent without leaving the editor opening the Ruby code.\n\n\u003e [!IMPORTANT]\n\u003e The maintainer is working to implement the inline RBS syntax to rbs-gem itself.\n\u003e This repository is not actively updated.\n\n\u003e [!IMPORTANT]\n\u003e This gem is a prototype for testing. We plan to merge this feature to rbs-gem and deprecate rbs-inline gem after that.\n\n\u003e [!NOTE]\n\u003e Use Steep \u003e= `1.8.0.dev` to avoid the conflicts on `#:` syntax.\n\nHere is a quick example of embedded declarations.\n\n```rb\n# rbs_inline: enabled\n\nclass Person\n  attr_reader :name #: String\n\n  attr_reader :addresses #: Array[String]\n\n  # You can write the type of parameters and return types.\n  #\n  # @rbs name: String\n  # @rbs addresses: Array[String]\n  # @rbs return: void\n  def initialize(name:, addresses:)\n    @name = name\n    @addresses = addresses\n  end\n\n  # Or write the type of the method just after `@rbs` keyword.\n  #\n  # @rbs () -\u003e String\n  def to_s\n    \"Person(name = #{name}, addresses = #{addresses.join(\", \")})\"\n  end\n\n  # The `:` syntax is the shortest one.\n  #\n  #: () -\u003e String\n  def hash\n    [name, addresses].hash\n  end\n\n  # @rbs \u0026block: (String) -\u003e void\n  def each_address(\u0026block) #: void\n    addresses.each(\u0026block)\n  end\nend\n```\n\nThis is equivalent to the following RBS type definition.\n\n```rbs\nclass Person\n  attr_reader name: String\n\n  attr_reader addresses: Array[String]\n\n  def initialize: (name: String, addresses: Array[String]) -\u003e void\n\n  def to_s: () -\u003e String\n\n  def each_address: () { (String) -\u003e void } -\u003e void\nend\n```\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add rbs-inline --require=false\n\nNote that the `--require=false` is important to avoid having type definition dependencies to this gem, which is usually unnecessary.\n\nYou can of course add a `gem` call in your Gemfile yourself.\n\n```rb\ngem 'rbs-inline', require: false\n```\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install rbs-inline\n\n## Usage\n\nThe gem works as a transpiler from annotated Ruby code to RBS files. Run `rbs-inline` command to generate RBS files, and use the generated files with Steep, or any tools which supports RBS type definitions.\n\n```sh\n# Print generated RBS files\n$ bundle exec rbs-inline lib\n\n# Save generated RBS files under sig/generated\n$ bundle exec rbs-inline --output lib\n```\n\nYou may want to use `fswatch` or likes to automatically generate RBS files when you edit the Ruby code.\n\n    $ fswatch -0 lib | xargs -0 -n1 bundle exec rbs-inline --output\n\n## More materials\n\n[Our wiki](https://github.com/soutaro/rbs-inline/wiki) has some materials to read.\n\n* [Syntax guide](https://github.com/soutaro/rbs-inline/wiki/Syntax-guide) explains more details of the syntax and annotations.\n* [Roadmap](https://github.com/soutaro/rbs-inline/wiki/Roadmap) explains some of the missing features and our plans.\n* [Snippets](https://github.com/soutaro/rbs-inline/wiki/Snippets) helps setting up your editors.\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/soutaro/rbs-inline. 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/soutaro/rbs-inline/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 Rbs::Inline project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/soutaro/rbs-inline/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoutaro%2Frbs-inline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoutaro%2Frbs-inline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoutaro%2Frbs-inline/lists"}