|
| 1 | +# Contributing to Klime Ruby SDK |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the Klime Ruby SDK! |
| 4 | + |
| 5 | +## Important: Repository Structure |
| 6 | + |
| 7 | +This repository is a **read-only mirror** of our internal monorepo. We develop and maintain the SDK internally, then mirror releases to this public repository. |
| 8 | + |
| 9 | +### What This Means for Contributors |
| 10 | + |
| 11 | +- **Pull requests are welcome** and will be reviewed by our team |
| 12 | +- If accepted, we'll **manually port your changes** to our internal monorepo |
| 13 | +- Your changes will appear in this repository with the **next release** |
| 14 | +- You'll be credited as a co-author in the commit |
| 15 | + |
| 16 | +## How to Contribute |
| 17 | + |
| 18 | +### Reporting Bugs |
| 19 | + |
| 20 | +1. Check if the bug has already been reported in [Issues](../../issues) |
| 21 | +2. If not, create a new issue with: |
| 22 | + - A clear, descriptive title |
| 23 | + - Steps to reproduce the bug |
| 24 | + - Expected vs actual behavior |
| 25 | + - Your environment (Ruby version, OS, etc.) |
| 26 | + - Any relevant code snippets or error messages |
| 27 | + |
| 28 | +### Suggesting Features |
| 29 | + |
| 30 | +1. Check if the feature has already been suggested in [Issues](../../issues) |
| 31 | +2. Create a new issue describing: |
| 32 | + - The problem you're trying to solve |
| 33 | + - Your proposed solution |
| 34 | + - Any alternatives you've considered |
| 35 | + |
| 36 | +### Submitting Code Changes |
| 37 | + |
| 38 | +1. Fork this repository |
| 39 | +2. Create a feature branch (`git checkout -b feat/amazing-feature`) |
| 40 | +3. Make your changes |
| 41 | +4. Write or update tests as needed |
| 42 | +5. Ensure all tests pass (`bundle exec rake test`) |
| 43 | +6. Commit using [Conventional Commits](https://www.conventionalcommits.org/): |
| 44 | + ``` |
| 45 | + feat: add new tracking method |
| 46 | + fix: handle edge case in batch processing |
| 47 | + docs: update README examples |
| 48 | + ``` |
| 49 | +7. Push to your fork and open a Pull Request |
| 50 | + |
| 51 | +### Pull Request Guidelines |
| 52 | + |
| 53 | +- Provide a clear description of what the PR does |
| 54 | +- Reference any related issues |
| 55 | +- Include tests for new functionality |
| 56 | +- Update documentation if needed |
| 57 | +- Keep PRs focused - one feature or fix per PR |
| 58 | + |
| 59 | +## Development Setup |
| 60 | + |
| 61 | +```bash |
| 62 | +# Clone your fork |
| 63 | +git clone https://github.com/YOUR_USERNAME/klime-ruby.git |
| 64 | +cd klime-ruby |
| 65 | + |
| 66 | +# Install dependencies |
| 67 | +bundle install |
| 68 | + |
| 69 | +# Run tests |
| 70 | +bundle exec rake test |
| 71 | + |
| 72 | +# Run linter |
| 73 | +bundle exec rubocop |
| 74 | +``` |
| 75 | + |
| 76 | +## Project Structure |
| 77 | + |
| 78 | +``` |
| 79 | +klime-ruby/ |
| 80 | +├── lib/ |
| 81 | +│ ├── klime.rb # Main entry point |
| 82 | +│ └── klime/ |
| 83 | +│ ├── client.rb # Main client implementation |
| 84 | +│ ├── event.rb # Event types |
| 85 | +│ └── version.rb # Version constant |
| 86 | +├── test/ |
| 87 | +├── klime.gemspec # Gem specification |
| 88 | +└── README.md |
| 89 | +``` |
| 90 | + |
| 91 | +## Code Style |
| 92 | + |
| 93 | +- We follow the [Ruby Style Guide](https://rubystyle.guide/) |
| 94 | +- Use meaningful variable and method names |
| 95 | +- Add YARD documentation for public APIs |
| 96 | +- Keep methods small and focused |
| 97 | + |
| 98 | +## Running Tests |
| 99 | + |
| 100 | +```bash |
| 101 | +# Run all tests |
| 102 | +bundle exec rake test |
| 103 | + |
| 104 | +# Run specific test file |
| 105 | +ruby -Ilib:test test/test_client.rb |
| 106 | +``` |
| 107 | + |
| 108 | +## Questions? |
| 109 | + |
| 110 | +If you have questions about contributing, feel free to open an issue and we'll be happy to help! |
| 111 | + |
| 112 | +## License |
| 113 | + |
| 114 | +By contributing, you agree that your contributions will be licensed under the MIT License. |
0 commit comments