{"id":51466358,"url":"https://github.com/undertakehq/ruby-standards","last_synced_at":"2026-07-06T11:32:03.356Z","repository":{"id":321163346,"uuid":"1084708789","full_name":"undertakehq/ruby-standards","owner":"undertakehq","description":"A base Ruby gem containing general language and project conventions","archived":false,"fork":false,"pushed_at":"2025-10-28T05:13:32.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-28T07:09:04.201Z","etag":null,"topics":["hacktoberfest","hacktoberfest-accepted","mit","mit-license","ruby","ruby-gem","standards"],"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/undertakehq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-28T03:49:28.000Z","updated_at":"2025-10-28T05:18:09.000Z","dependencies_parsed_at":"2025-10-28T07:09:19.321Z","dependency_job_id":"7a6f788c-4184-4b2b-8882-15817a8e21da","html_url":"https://github.com/undertakehq/ruby-standards","commit_stats":null,"previous_names":["undertakehq/ruby-standards"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/undertakehq/ruby-standards","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undertakehq%2Fruby-standards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undertakehq%2Fruby-standards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undertakehq%2Fruby-standards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undertakehq%2Fruby-standards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/undertakehq","download_url":"https://codeload.github.com/undertakehq/ruby-standards/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undertakehq%2Fruby-standards/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35189713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"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":["hacktoberfest","hacktoberfest-accepted","mit","mit-license","ruby","ruby-gem","standards"],"created_at":"2026-07-06T11:32:03.235Z","updated_at":"2026-07-06T11:32:03.322Z","avatar_url":"https://github.com/undertakehq.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Undertake HQ Ruby Standards\n\nA Ruby gem that provides general conventions, standards, and best practices for Ruby development projects.\n\n**undertakehq-ruby-standards** establishes patterns and utilities that can be shared across Ruby teams and projects, serving as a foundational layer for applications and other gems. It's designed with the philosophy of \"convention over configuration\" to minimize setup while providing powerful, reusable functionality.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'undertakehq-ruby-standards'\n```\n\nThen execute:\n\n```bash\nbundle install\n```\n\nOr install it yourself as:\n\n```bash\ngem install undertakehq-ruby-standards\n```\n\n## Ruby Version\n\nThis gem requires **Ruby 3.4+** and has no framework dependencies (works with vanilla Ruby, Rails, or any other framework).\n\n## Usage\n\n### Getting Started\n\nOnce installed, you can require the gem in your project:\n\n```ruby\nrequire 'undertakehq/ruby_standards'\n```\n\nThis will load the core functionality provided by the gem. Specific modules can also be required individually for more granular control.\n\n## Features\n\nThis gem provides standardized conventions and utilities for:\n\n- **Code Organization**: Established patterns for structuring Ruby code\n- **Utilities**: Reusable helper functions and utilities\n- **Extensions**: Safe extensions to Ruby standard library classes\n- **Configuration**: Configurable standards that can be customized per project\n- **RuboCop Integration**: Comprehensive linting rules with specialized extensions\n- **Minitest Enhancements**: Enhanced test assertions and helpers\n- **Custom Cops**: Project-specific RuboCop cops for code quality\n\n### RuboCop Extensions\n\nThe gem includes specialized RuboCop extensions for:\n\n- **rubocop-minitest**: Linting rules for Minitest test files that enforce best practices\n- **rubocop-rake**: Linting rules for Rake task definitions to improve build scripts\n\nThese extensions help maintain consistent code quality across your Ruby projects.\n\n## Development\n\n### Setup\n\n```bash\nbundle install\n```\n\n### Running Tests\n\n```bash\n# Run all tests\nbundle exec rake test\n\n# Run a specific test file\nbundle exec ruby -Ilib:test test/path/to/file_test.rb\n\n# Run tests matching a pattern\nbundle exec rake test TESTOPTS=\"--name=pattern\"\n```\n\n### Linting and Code Quality\n\n```bash\n# Check code style (includes minitest and rake extensions)\nbundle exec rubocop\n\n# Auto-fix violations\nbundle exec rubocop -A\n\n# Check for vulnerable dependencies\nbundle exec bundler-audit check\n```\n\nThe RuboCop configuration includes specialized extensions that provide:\n\n- **Minitest linting**: Enforces best practices like using `assert`/`refute` over `assert_equal true/false`\n- **Rake task linting**: Ensures proper Rake task definitions and descriptions\n- **Ruby style enforcement**: Comprehensive Ruby style guide adherence\n- **Production code quality**: Custom cops that discourage production anti-patterns\n\n### Custom Cops\n\n#### Undertakehq/AvoidSleep\n\nThe `AvoidSleep` cop discourages the use of `sleep` calls in production code, as they can lead to blocking operations and poor performance.\n\n**What it detects:**\n\n- All variants of sleep calls: `sleep()`, `Kernel.sleep()`, `::Kernel.sleep()`\n- Any sleep duration including zero, integer, and decimal values\n\n**What it ignores:**\n\n- Non-Kernel receivers: `my_object.sleep()`, `some_module.sleep()` - these are intentional method calls on custom objects\n- Variable or method definitions named `sleep` - the cop only targets actual method calls\n\n**Examples:**\n\n```ruby\n# bad - detected in all variants\nsleep(5)\nsleep 5\nKernel.sleep(5)\n::Kernel.sleep(5)\n\n# good - use alternatives\nSomeJob.set(wait: 5.seconds).perform_later\nretry_with_backoff { api_call }\n\n# allowed - non-Kernel receivers are ignored\nmy_object.sleep(5)      # Custom sleep method\nsleep_scheduler.sleep() # Domain-specific sleep\n```\n\n**Note:** The cop flags sleep calls regardless of file context. If you need to allow sleep in test files, you can configure excludes in your project's RuboCop configuration.\n\n### Using in Your Projects\n\nTo use the RuboCop configuration in your own projects, add this to your `.rubocop.yml`:\n\n```yaml\ninherit_gem:\n  undertakehq-ruby-standards: config/rubocop.yml\n```\n\n### Building the Gem\n\n```bash\ngem build undertakehq-ruby-standards.gemspec\n```\n\n## Architecture\n\n### Directory Structure\n\n```\nlib/\n├── undertakehq/\n│   ├── ruby_standards.rb       # Main entry point\n│   ├── ruby_standards/\n│   │   ├── version.rb          # Version definition\n│   │   ├── config.rb           # Configuration\n│   │   └── ...                 # Feature modules\ntest/\n├── test_helper.rb              # Test setup and helpers\n└── ...                         # Test files\nGemfile                         # Development dependencies\nRakefile                        # Rake tasks including test runner\nundertakehq-ruby-standards.gemspec  # Gem specification\n```\n\n### Core Modules\n\nWhen fully implemented, this gem will include modules for various standard practices. Each module can be required and used independently.\n\n## Configuration\n\nConfiguration can be customized in your initializer (if using with Rails) or directly in your application:\n\n```ruby\nUndertakehq::RubyStandards.configure do |config|\n  # Configuration options will be available here\nend\n```\n\n## Contributing\n\nWe welcome contributions from the community! Please read our [CONTRIBUTING.md](CONTRIBUTING.md) guide for details on our code of conduct and the process for submitting pull requests.\n\n## Development Status\n\nThis project is actively under development. Contributions are welcome via pull requests.\n\n## License\n\nThis gem is released under the MIT License. See [LICENSE](LICENSE) for details.\n\n## Code of Conduct\n\nThis project and everyone participating in it is governed by the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). By participating, you are expected to uphold this code.\n\n## Related Projects\n\n- [undertakehq-rails-standards](https://github.com/undertakehq/rails-standards) - Rails-specific conventions and standards built on top of undertakehq-ruby-standards\n\n## Support\n\nFor issues, questions, or suggestions, please open an issue on the [GitHub repository](https://github.com/undertakehq/ruby-standards).\n\n---\n\nMade with ❤️ by the Undertake HQ team\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fundertakehq%2Fruby-standards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fundertakehq%2Fruby-standards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fundertakehq%2Fruby-standards/lists"}