{"id":13878433,"url":"https://github.com/y-crdt/yrb","last_synced_at":"2025-04-09T20:08:57.669Z","repository":{"id":38358923,"uuid":"489413644","full_name":"y-crdt/yrb","owner":"y-crdt","description":"Ruby bindings for yrs.","archived":false,"fork":false,"pushed_at":"2025-03-03T13:51:45.000Z","size":1857,"stargazers_count":89,"open_issues_count":6,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-09T20:08:51.267Z","etag":null,"topics":["collaborative-editing","crdt","real-time","ruby"],"latest_commit_sha":null,"homepage":"https://y-crdt.github.io/yrb","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/y-crdt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2022-05-06T15:56:36.000Z","updated_at":"2025-03-03T13:51:30.000Z","dependencies_parsed_at":"2024-04-16T12:45:00.295Z","dependency_job_id":null,"html_url":"https://github.com/y-crdt/yrb","commit_stats":{"total_commits":193,"total_committers":3,"mean_commits":64.33333333333333,"dds":"0.33678756476683935","last_synced_commit":"ba25556f59ce144ec801b7cbf8fe8e8c4ef00c45"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y-crdt%2Fyrb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y-crdt%2Fyrb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y-crdt%2Fyrb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y-crdt%2Fyrb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/y-crdt","download_url":"https://codeload.github.com/y-crdt/yrb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"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","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":["collaborative-editing","crdt","real-time","ruby"],"created_at":"2024-08-06T08:01:49.537Z","updated_at":"2025-04-09T20:08:57.646Z","avatar_url":"https://github.com/y-crdt.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Yrb\" src=\"./docs/assets/logo.png\" width=\"300\" /\u003e\n\u003c/p\u003e\n\n---\n\n# yrb\n\n\u003e Ruby bindings for yrs (\"wires\")\n\nYrb is a Ruby binding for Y-CRDT. It provides distributed data types that enable\nreal-time collaboration between devices. Yrb can sync data with any other\nplatform that has a Y-CRDT binding, allowing for seamless cross-domain\ncommunication.\n\nThe library is a thin wrapper around Yrs, taking advantage of the safety and\nperformance of Rust.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'y-rb'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install y-rb\n\n### Required RubyGems version\n\nIf you want to use `y-rb` on `x86_64-linux-musl` systems, you most likely need\nto update your system RubyGems due to a\n[bug in RubyGems \u003c 3.3.21](https://github.com/rubygems/rubygems/pull/5852). For\nolder RubyGems versions, the platform is described as `x86_64-linux-musl`, but\n`x86_64-linux` is fetched instead. \n\n```bash\ngem update --system\n```\n\n## Usage\n\n```ruby\n# creates a new document and text structure\nlocal = Y::Doc.new \nlocal_text = local.get_text(\"my text\")\n\n# add some data to the text structure\nlocal_text \u003c\u003c \"hello\"  \n  \n# create a remote document sharing the same text structure\nremote = Y::Doc.new \nremote_text = remote.get_text(\"my text\")  \n\n# retrieve the current state of the remote document\nremote_state = remote.state  \n\n# create an update for the remote document based on the current\n# state of the remote document\nupdate = local.diff(remote_state)  \n  \n# apply update to remote document\nremote.sync(update)  \n\nputs remote_text.to_s == local_text.to_s # true  \n```  \n\nMore [examples](docs/examples.md).\n\n## Development\n\nMake sure you have `cargo` available (2021 edition). The gem needs the lib to\nbe built every time when there is a change.\n\n```bash\ncargo build --release\n```\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then,\nrun `rake spec` to run the tests. You can also run `bin/console` for an\ninteractive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\nTo release a new version, update the version number in `version.rb`, and then\nrun `bundle exec rake release`, which will create a git tag for the version,\npush git commits and the created tag, and push the `.gem` file to\n[rubygems.org](https://rubygems.org).\n\n## Docs\n\nYou can run `yard` locally and open the docs with:\n\n```bash\nyard server \nopen \"http://0.0.0.0:8808/\"\n```\n\n## Decision log\n\nFor this `gem`, we maintain a [decision log](docs/decisions.md). Please consult it\nin case there is some ambiguity in terms of why certain implementation details\nlook as they are. \n\n## License\n\nThe gem is available as open source under the terms of the\n[MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy-crdt%2Fyrb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fy-crdt%2Fyrb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy-crdt%2Fyrb/lists"}