{"id":16065809,"url":"https://github.com/marcoroth/rubocop-cable_ready","last_synced_at":"2025-09-11T14:32:12.250Z","repository":{"id":46528097,"uuid":"380816616","full_name":"marcoroth/rubocop-cable_ready","owner":"marcoroth","description":"Code style checking for CableReady","archived":false,"fork":false,"pushed_at":"2023-02-17T18:58:49.000Z","size":28,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-31T08:52:08.664Z","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/marcoroth.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}},"created_at":"2021-06-27T18:57:06.000Z","updated_at":"2023-03-09T03:11:28.000Z","dependencies_parsed_at":"2024-10-09T05:21:05.735Z","dependency_job_id":null,"html_url":"https://github.com/marcoroth/rubocop-cable_ready","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Frubocop-cable_ready","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Frubocop-cable_ready/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Frubocop-cable_ready/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Frubocop-cable_ready/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcoroth","download_url":"https://codeload.github.com/marcoroth/rubocop-cable_ready/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232654813,"owners_count":18556470,"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":[],"created_at":"2024-10-09T05:21:00.383Z","updated_at":"2025-01-05T23:42:56.801Z","avatar_url":"https://github.com/marcoroth.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RuboCop::CableReady\n\nCableReady-specific analysis for your projects, as an extension to [RuboCop](https://github.com/rubocop/rubocop).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rubocop-cable_ready'\n```\n\nAnd then execute:\n\n```bash\nbundle install\n```\n\nOr install it yourself as:\n\n```bash\ngem install rubocop-cable_ready\n```\n\n## Usage\n\nYou need to tell RuboCop to load the CableReady extension. There are threeways to do this:\n\n### RuboCop configuration file\n\nPut this into your `.rubocop.yml`.\n\n```yaml\nrequire: rubocop-cable_ready\n```\n\nAlternatively, use the following array notation when specifying multiple extensions.\n\n```yaml\nrequire:\n  - rubocop-other-extension\n  - rubocop-cable_ready\n```\n\nNow you can run `rubocop` and it will automatically load the RuboCop CableReady cops together with the standard cops.\n\n### Command line\n\n```bash\nrubocop --require rubocop-cable_ready\n```\n\n### Rake task\n\n```ruby\nRuboCop::RakeTask.new do |task|\n  task.requires \u003c\u003c 'rubocop-cable_ready'\nend\n```\n\n## Cops\n\n#### `CableReady/ApplicationRecordEnableUpdates`\n\n| Enabled by default | Supports autocorrection | Include | Version Added | Version Changed |\n| --- | --- | --- | --- | --- |\n| true | No | `app/models/**/*.rb` | 0.2.0 | 0.2.0 |\n\nThe `enable_cable_ready_updates` class method shouldn't be called in `ApplicationRecord`. Instead call `enable_cable_ready_updates` in every model you want to track and broadcast updates.\n\n\n##### Examples\n\n```ruby\n# bad\n\nclass ApplicationRecord \u003c ActiveRecord::Base\n  include CableReady::Updatable\n\n  enable_cable_ready_updates on: :update\nend\n\n\n# good\n\nclass Post \u003c ApplicationRecord\n  include CableReady::Updatable\n\n  enable_cable_ready_updates on: :update\nend\n\n\n# good\n\nclass ApplicationRecord \u003c ActiveRecord::Base\n  include CableReady::Updatable\nend\n\nclass Post \u003c ApplicationRecord\n  enable_cable_ready_updates on: :update\nend\n```\n\n----\n\n#### `CableReady/BroadcasterControllerAction`\n\n| Enabled by default | Supports autocorrection | Include | Version Added | Version Changed |\n| --- | --- | --- | --- | --- |\n| false | No | `app/controllers/**/*.rb` | 0.2.0 | 0.2.0 |\n\nIt's discouraged to broadcast CableReady broadcasts from Controller actions.\n\n##### Examples\n\n```ruby\n# bad\n\ndef create\n  cable_ready[UserChannel]\n    .append(selector: \"...\", html: \"...\")\n    .broadcast\nend\n\n\n# good\n\ndef create\nend\n```\n\n----\n\n#### `CableReady/UnusedCableReadyCall`\n\n| Enabled by default | Supports autocorrection | Include | Version Added | Version Changed |\n| --- | --- | --- | --- | --- |\n| true | No | `app/**/*.rb` | 0.1.0 | 0.1.0 |\n\nThe `cable_ready` method shouldn't be called without being followed by an operation.\n\n##### Examples\n\n```ruby\n# bad\n\ncable_ready\n\n\n# good\n\ncable_ready.inner_html(...)\n```\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/marcoroth/rubocop-cable_ready. 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/marcoroth/rubocop-cable_ready/blob/master/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 RuboCop::CableReady project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/marcoroth/rubocop-cable_ready/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoroth%2Frubocop-cable_ready","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcoroth%2Frubocop-cable_ready","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoroth%2Frubocop-cable_ready/lists"}