{"id":31802329,"url":"https://github.com/sylvance/proto_dsl","last_synced_at":"2025-10-11T00:23:17.308Z","repository":{"id":64336683,"uuid":"574986506","full_name":"Sylvance/proto_dsl","owner":"Sylvance","description":"It provides a simple, readable syntax for defining Protocol Buffer message types using Ruby code. ","archived":false,"fork":false,"pushed_at":"2022-12-08T09:43:21.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T02:58:20.504Z","etag":null,"topics":["dsl","protobuf","ruby"],"latest_commit_sha":null,"homepage":"https://github.com/Sylvance/proto_dsl","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/Sylvance.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-06T14:04:24.000Z","updated_at":"2023-03-26T09:18:23.000Z","dependencies_parsed_at":"2023-01-25T09:30:24.418Z","dependency_job_id":null,"html_url":"https://github.com/Sylvance/proto_dsl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Sylvance/proto_dsl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sylvance%2Fproto_dsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sylvance%2Fproto_dsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sylvance%2Fproto_dsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sylvance%2Fproto_dsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sylvance","download_url":"https://codeload.github.com/Sylvance/proto_dsl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sylvance%2Fproto_dsl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005654,"owners_count":26083941,"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-10T02:00:06.843Z","response_time":62,"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":["dsl","protobuf","ruby"],"created_at":"2025-10-11T00:23:15.786Z","updated_at":"2025-10-11T00:23:17.293Z","avatar_url":"https://github.com/Sylvance.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProtoDsl\n\nThe `ProtoDsl::DSL` is a Domain Specific Language (DSL) for defining Protocol Buffer message types. It provides a simple, readable syntax for defining Protocol Buffer message types using Ruby code. The `to_proto` method can be used to convert the defined message types into the Protocol Buffer syntax.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add proto_dsl\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install proto_dsl\n\n## Usage\n\nThis gem defines a `Protocol Buffer` message type using the `ProtoDsl::DSL` class. It specifies the syntax version, package name, and import paths. It also sets some options and defines a service with two RPCs. The code also defines several message types, an enum, and a oneof field. The to_proto method at the end of the code converts the defined message types into the Protocol Buffer syntax.\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'proto_dsl'\n\nProtoDsl::Dsl.new.tap do |dsl|\n  dsl.syntax \"proto2\"\n  dsl.package \"my_package\"\n  dsl.import \"google/protobuf/wrappers.proto\"\n\n  dsl.option \"java_package\", \"com.example.app\"\n  dsl.option \"java_outer_classname\", \"MyProto\"\n\n  dsl.service \"MyService\" do\n    rpc \"GetData\", \"GetDataRequest\", \"GetDataResponse\"\n    rpc \"UpdateData\", \"UpdateDataRequest\", \"UpdateDataResponse\" do\n      option \"method\", \"POST\"\n    end\n  end\n\n  dsl.message \"GetDataRequest\" do\n    field \"string\", \"id\", 1\n    field \"int32\", \"version\", 2\n\n    message \"Filter\" do\n      field \"string\", \"field\", 1\n      field \"string\", \"value\", 2\n    end\n\n    field \"repeated\", \"filters\", 3, type: \"Filter\"\n\n    oneof \"params\" do\n      option \"deprecated\", true\n      field \"string\", \"id\", 1\n      field \"int32\", \"version\", 2\n    end\n  end\n\n  dsl.message \"GetDataResponse\" do\n    field \"string\", \"data\", 1\n  end\n\n  dsl.message \"UpdateDataRequest\" do\n    field \"string\", \"id\", 1\n    field \"int32\", \"version\", 2\n    field \"string\", \"data\", 3\n  end\n\n  dsl.message \"UpdateDataResponse\" do\n    field \"bool\", \"success\", 1\n  end\n\n  dsl.enum \"Status\" do\n    value \"OK\", 0\n    value \"ERROR\", 1\n  end\nend.to_proto\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` 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/Sylvance/proto_dsl. 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/Sylvance/proto_dsl/blob/main/CODE_OF_CONDUCT.md).\n\n## Code of Conduct\n\nEveryone interacting in the ProtoDsl project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Sylvance/proto_dsl/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylvance%2Fproto_dsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsylvance%2Fproto_dsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylvance%2Fproto_dsl/lists"}