{"id":25831292,"url":"https://github.com/animatedledstrip/client-ruby","last_synced_at":"2026-05-09T20:36:41.102Z","repository":{"id":62553289,"uuid":"283901162","full_name":"AnimatedLEDStrip/client-ruby","owner":"AnimatedLEDStrip","description":"Library for connecting to an AnimatedLEDStrip server from clients written in Ruby","archived":false,"fork":false,"pushed_at":"2021-02-01T20:31:33.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-26T17:08:58.107Z","etag":null,"topics":["als-client-library","als-library"],"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/AnimatedLEDStrip.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}},"created_at":"2020-07-31T00:01:04.000Z","updated_at":"2021-02-02T02:21:49.000Z","dependencies_parsed_at":"2022-11-03T04:30:32.069Z","dependency_job_id":null,"html_url":"https://github.com/AnimatedLEDStrip/client-ruby","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnimatedLEDStrip%2Fclient-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnimatedLEDStrip%2Fclient-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnimatedLEDStrip%2Fclient-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnimatedLEDStrip%2Fclient-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnimatedLEDStrip","download_url":"https://codeload.github.com/AnimatedLEDStrip/client-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241226912,"owners_count":19930489,"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":["als-client-library","als-library"],"created_at":"2025-02-28T20:33:17.788Z","updated_at":"2026-05-09T20:36:41.046Z","avatar_url":"https://github.com/AnimatedLEDStrip.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AnimatedLEDStrip Client Library for Ruby\n\n[![Build Status](https://travis-ci.com/AnimatedLEDStrip/client-ruby.svg?branch=master)](https://travis-ci.com/AnimatedLEDStrip/client-ruby)\n[![Gem Version](https://badge.fury.io/rb/animatedledstrip-client.svg)](https://badge.fury.io/rb/animatedledstrip-client)\n[![codecov](https://codecov.io/gh/AnimatedLEDStrip/client-ruby/branch/master/graph/badge.svg)](https://codecov.io/gh/AnimatedLEDStrip/client-ruby)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'animatedledstrip-client'\n```\n\nOr install with:\n\n    $ gem install animatedledstrip-client\n\n## Creating an `AnimationSender`\nAn `AnimationSender` is constructed with two arguments:\n- `host`: The IP address of the server (as a string)\n- `port`: The port that the client should connect to (as an integer)\n\n```ruby\nsender = AnimationSender.new(\"10.0.0.254\", 5);\n```\n\n## Starting the `AnimationSender`\nAn `AnimationSender` is started by calling the `start()` method on the instance.\n\n```ruby\nsender.start\n```\n\n## Stopping the `AnimationSender`\nTo stop the `AnimationSender`, call its `end()` method.\n\n```ruby\nsender.end\n```\n\n## Sending Data\n\n### AnimationData\nAn animation can be sent to the server by creating an `AnimationData` instance, then calling `send_animation` with the instance as the argument.\n\n```ruby\ncc = ColorContainer.new\ncc.add_color 0xFF\ncc.add_color 0xFF00\n\ndata = AnimationData.new\ndata.add_color cc\n\nsender.send_animation data\n```\n\n### EndAnimation\nThe end of an animation can be sent to the server by creating an `EndAnimation` instance, then calling `send_end_animation` with the instance as the argument.\n\n```ruby\nend_anim = EndAnimation.new\nend_anim.id = \"ANIM_ID\"\n\nsender.send_end_animation end_anim\n```\n\n### Section\nA new section can be sent to the server by creating a `Section` instance, then calling `send_section` with the instance as the argument.\nNote that changing `num_leds` or `physical_start` will have no effect on the new section.\n\n```ruby\nsect = Section.new\nsect.name = \"SECTION\"\nsect.start_pixel = 5\nsect.end_pixel = 30\n\nsender.send_section sect\n```\n\n#### `AnimationData` type notes\nThe Ruby library uses the following values for `continuous` and `direction`:\n- `continuous`: `nil`, `true`, `false`\n- `direction`: `Direction::FORWARD`, `Direction::BACKWARD`\n\n## Receiving Data\n\n### Supported Animations\nSupported animations are stored in the sender's `supported_animations` hash.\n\n### Running Animations\nRunning animations are stored in the sender's `running_animations` hash.\n\n### Ending Animations\nAnimations are removed from the sender's `running_animations` hash.\n\n### New Section\nSections are stored in the sender's `sections` hash.\n\n### Strip Info\nThe strip's info is stored in the sender's `strip_info` attribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimatedledstrip%2Fclient-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanimatedledstrip%2Fclient-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimatedledstrip%2Fclient-ruby/lists"}