{"id":25036660,"url":"https://github.com/pezzos/ruby","last_synced_at":"2026-03-09T18:39:57.038Z","repository":{"id":273323981,"uuid":"918220472","full_name":"pezzos/ruby","owner":"pezzos","description":"This project provides a containerized Ruby development environment that seamlessly integrates with your local machine while maintaining isolation and consistency.","archived":false,"fork":false,"pushed_at":"2025-06-11T08:25:57.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T09:31:31.950Z","etag":null,"topics":["docker","ruby","rubygem"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/pezzos.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,"zenodo":null}},"created_at":"2025-01-17T13:44:32.000Z","updated_at":"2025-06-11T08:26:02.000Z","dependencies_parsed_at":"2025-04-16T16:12:43.028Z","dependency_job_id":"4f4c20b6-8a99-4e9c-9edb-8e0e1e87b908","html_url":"https://github.com/pezzos/ruby","commit_stats":null,"previous_names":["pezzos/ruby"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pezzos/ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pezzos%2Fruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pezzos%2Fruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pezzos%2Fruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pezzos%2Fruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pezzos","download_url":"https://codeload.github.com/pezzos/ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pezzos%2Fruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30307549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T17:35:44.120Z","status":"ssl_error","status_checked_at":"2026-03-09T17:35:43.707Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["docker","ruby","rubygem"],"created_at":"2025-02-06T00:06:27.448Z","updated_at":"2026-03-09T18:39:57.020Z","avatar_url":"https://github.com/pezzos.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby Development Environment with Docker\n\nThis project provides a containerized Ruby development environment that seamlessly integrates with your local machine while maintaining isolation and consistency. It's designed to make Ruby development easier by handling common development tasks in a containerized environment, preventing \"works on my machine\" issues.\n\n## Key Features\n\n### Containerized Development Environment\n- Complete Ruby 3.1 environment with essential development tools\n- Automatic bundle management and gem caching\n- Basic concurrent installation protection (via status checks)\n- Seamless integration with local filesystem\n- MacOS path compatibility handled via Docker volume mapping\n\n### Smart Command Wrappers\n- Automatic `bundle install` execution when potentially needed (based on last run timestamp).\n- Most commands run via `bundle exec` by default for correct gem context.\n- Intelligent configuration file detection (e.g., `.rubocop.yml` by RuboCop itself).\n- Proper exit code and signal handling.\n- Environment variable preservation via temporary files.\n- Enhanced error reporting for failed commands.\n\n### Development Tools Support\n- Ruby command execution\n- Interactive Ruby console (IRB)\n- RSpec test runner\n- Rubocop with automatic config detection\n- Rake task execution\n- Test Kitchen for Chef development\n- Bundle management\n- Gem handling\n\n## Setup Instructions\n\n1. Clone the repository:\n```bash\ngit clone \u003crepository-url\u003e\ncd \u003crepository-name\u003e\n```\n\n2. Build the Docker image and create the required Docker volumes:\n```bash\n# Use --progress=plain to see build logs, including cache usage\ndocker build --progress=plain --build-arg USER=$(whoami) -t ruby-dev .\ndocker volume create bundle_cache31\ndocker volume create ruby_dev_locks\n```\n\n3. Install the function definitions:\n```bash\ncp ruby-functions.zsh $HOME/.ruby-functions.zsh\n# Check if .ruby-functions.zsh is already sourced in .zshrc\nif ! grep -q 'source.*\\.ruby-functions\\.zsh' \"$HOME/.zshrc\"; then\n  echo \"source \\\"$HOME/.ruby-functions.zsh\\\"\" \u003e\u003e ~/.zshrc\nfi\nsource ~/.zshrc\n```\n\n## Usage Examples\n\n### Basic Ruby Commands\n```bash\n# Run Ruby script\nruby script.rb\n\n# Start interactive console\nirb\n\n# Execute gem commands\ngem list\n```\n\n### Testing and Linting\n```bash\n# Run RSpec tests\nrspec\n\n# Run Rubocop with automatic config detection\nrubocop\n\n# Run specific Rubocop checks\nrubocop app/models\n```\n\n### Bundle Management\n```bash\n# Install dependencies\nbundle install\n\n# Update gems\nbundle update\n\n# Execute commands through bundle\nbundle exec rake db:migrate\n```\n\n### Testing the install itself\n```bash\ntest-ruby\n```\n\n## Technical Details\n\n### Volume Management\n- `bundle_cache31`: Persists installed gems, cached across builds.\n- `ruby_dev_locks`: Persists lock files (currently minimal usage, primarily for `.last_bundle_install` if moved here).\n- Local filesystem mounting: Maps your home directory (`/Users/$USER` to `/home/$USER`).\n\n### Bundle Installation Check\n- Before running commands like `rspec`, `rubocop`, etc., the wrapper functions check if a `bundle install` might be needed.\n- Currently, this check is based on the timestamp of a `.last_bundle_install` file created in the project root after a successful install (older than 24 hours triggers a check).\n- If needed, `bundle clean --force` followed by `bundle install` is executed automatically.\n- **Note:** This mechanism is simpler than the previous lock system and primarily prevents redundant installs during active development within a 24h window. It doesn't offer robust locking against truly parallel `bundle install` commands run manually.\n\n### Environment Handling\n- Preserves most local environment variables by writing them to a temporary file passed to the container (`--env-file`).\n- Maintains proper locale settings (UTF-8).\n- Path mapping between host and container is handled directly by Docker's volume mounting.\n\n## Troubleshooting\n\n### Common Issues\n1. Lock files not clearing:\n```bash\ndocker volume rm ruby_dev_locks\ndocker volume create ruby_dev_locks\n```\n\n2. Bundle cache issues:\n```bash\ndocker volume rm bundle_cache31\ndocker volume create bundle_cache31\n```\n\n3. Permission problems:\n```bash\ndocker build --build-arg USER=$(whoami) -t ruby-dev .\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit pull requests with improvements or bug fixes.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE) - see the [LICENSE](LICENSE) file for details.\n\n#### Best Practices\n\nWhen modifying the entrypoint (`entrypoint.sh`):\n- Maintain the use of `exec` for proper signal handling\n- Consider bundle context requirements\n- Preserve argument passing with `\"${@:2}\"`\n- Add appropriate error handling\n- Document new commands and their usage\n\nWhen modifying the Zsh functions (`ruby-functions.zsh`):\n- Prefer using the `_run_in_ruby_dev` helper function.\n- Ensure `_run_bundle_install_if_needed` is called where appropriate.\n- Handle exit codes properly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpezzos%2Fruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpezzos%2Fruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpezzos%2Fruby/lists"}