{"id":18728802,"url":"https://github.com/rubyonworld/capnp-ruby","last_synced_at":"2026-04-10T21:03:47.292Z","repository":{"id":174007855,"uuid":"542153429","full_name":"RubyOnWorld/capnp-ruby","owner":"RubyOnWorld","description":"This here is a Ruby wrapper for the official C++ implementation of Cap'n Proto.","archived":false,"fork":false,"pushed_at":"2022-09-27T16:43:02.000Z","size":185,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T20:33:06.565Z","etag":null,"topics":["capnp","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"C++","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/RubyOnWorld.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":"2022-09-27T15:19:41.000Z","updated_at":"2022-09-27T18:16:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc143ad5-676d-48d0-8890-31ca9f058da0","html_url":"https://github.com/RubyOnWorld/capnp-ruby","commit_stats":null,"previous_names":["rubyonworld/capnp-ruby"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RubyOnWorld/capnp-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fcapnp-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fcapnp-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fcapnp-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fcapnp-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyOnWorld","download_url":"https://codeload.github.com/RubyOnWorld/capnp-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fcapnp-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31658982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"ssl_error","status_checked_at":"2026-04-10T17:19:13.364Z","response_time":98,"last_error":"SSL_read: 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":["capnp","rails","ruby"],"created_at":"2024-11-07T14:24:24.915Z","updated_at":"2026-04-10T21:03:47.254Z","avatar_url":"https://github.com/RubyOnWorld.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/cstrahan/capnp-ruby/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n![Cap'n Proto][logo]\n\n# Ruby Edition\n\nThis here is a [Ruby][ruby] wrapper for the official C++ implementation of [Cap'n Proto][capnp].\n\n[![Build Status][travis-badge]][travis-link]\n\n# Installing\n\nFirst [install libcapnp][libcapnp-install], then install the gem:\n\n```bash\ngem install capn_proto --pre\n```\n\nThe native extension for this gem requires a C++ compiler with C++11 features, so use the same C++ compiler and flags that you used to compile libcapnp (e.g. `CXX` and `CXXFLAGS`). As an OSX user, having followed the [instructions for installing libcapnp on OSX][libcapnp-install], the correct incantation is as follows:\n\n```bash\nCXX=$HOME/clang-3.2/bin/clang++ gem install capn_proto --pre\n```\n\n# Example\n\n```ruby\nrequire 'capn_proto'\n\nmodule AddressBook extend CapnProto::SchemaLoader\n  load_schema(\"addressbook.capnp\")\nend\n\ndef write_address_book(file)\n  addresses = AddressBook::AddressBook.new_message\n  people = addresses.initPeople(2)\n\n  alice = people[0]\n  alice.id = 123\n  alice.name = 'Alice'\n  alice.email = 'alice@example.com'\n  alice_phones = alice.initPhones(1)\n  alice_phones[0].number = \"555-1212\"\n  alice_phones[0].type = 'mobile'\n  alice.employment.school = \"MIT\"\n\n  bob = people[1]\n  bob.id = 456\n  bob.name = 'Bob'\n  bob.email = 'bob@example.com'\n  bob_phones = bob.initPhones(2)\n  bob_phones[0].number = \"555-4567\"\n  bob_phones[0].type = 'home'\n  bob_phones[1].number = \"555-7654\"\n  bob_phones[1].type = 'work'\n  bob.employment.unemployed = nil\n\n  addresses.write(file)\nend\n\ndef print_address_book(file)\n  addresses = AddressBook::AddressBook.read_from(file)\n\n  addresses.people.each do |person|\n    puts \"#{person.name} : #{person.email}\"\n\n    person.phones.each do |phone|\n      puts \"#{phone.type} : #{phone.number}\"\n    end\n\n    if person.employment.unemployed?\n      puts \"unemployed\"\n    if person.employment.employer?\n      puts \"employer: #{person.employment.employer}\"\n    if person.employment.school?\n      puts \"student at: #{person.employment.school}\"\n    if person.employment.selfEmployed?\n      puts \"self employed\"\n    end\n  end\nend\n\nif __FILE__ == $0\n  file = File.open(\"addressbook.bin\", \"wb\")\n  write_address_book(file)\n\n  file = File.open(\"addressbook.bin\", \"rb\")\n  print_address_book(file)\nend\n```\n\n# Status\n\nWhat's implemented:\n- Schema parsing/loading\n- Message reading\n  - From byte string\n  - From file descriptor\n- Message writing\n  - To byte string\n  - To file descriptor\n\nWhat's to come:\n- More reading/writing mechanisms:\n  - Packing/unpacking\n- Extensive test coverage\n- Proper support for [JRuby][jruby]\n- Support for RPC\n\n[logo]: https://raw.github.com/cstrahan/capnp-ruby/master/media/captain_proto_small.png \"Cap'n Proto\"\n[ruby]: http://www.ruby-lang.org/ \"Ruby\"\n[capnp]: http://kentonv.github.io/capnproto/ \"Cap'n Proto\"\n[jruby]: http://jruby.org/ \"JRuby\"\n[libcapnp-install]: http://kentonv.github.io/capnproto/install.html \"Installing Cap'n Proto\"\n[mit-license]: http://opensource.org/licenses/MIT \"MIT License\"\n\n[travis-link]: https://travis-ci.org/cstrahan/capnp-ruby\n[travis-badge]: https://travis-ci.org/cstrahan/capnp-ruby.png?branch=master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fcapnp-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyonworld%2Fcapnp-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fcapnp-ruby/lists"}