Thank you for considering contributing to our Cloudways API integration project! We appreciate your help in improving this project and following these guidelines to maintain code quality and consistency.
To contribute, please follow these steps to set up the development environment.
First, fork the repository to your GitHub account and clone it locally.
git clone [email protected]:your-username/ruby_api_pack_cloudways.git
cd ruby_api_pack_cloudways
Install the required dependencies using bundler
.
bundle install
You'll need valid Cloudways API credentials to run the application. Configure these credentials using the gem's configuration block:
RubyApiPackCloudways.configure do |config|
config.api_url = '<YOUR_CLOUDWAYS_API_URL>'
config.api_path_token = '<YOUR_TOKEN_PATH>'
config.api_email = '<YOUR_CLOUDWAYS_EMAIL>'
config.api_key = '<YOUR_CLOUDWAYS_API_KEY>'
end
Ensure that everything is working by running the test suite.
bundle exec rspec
We follow Ruby best practices and conventions. Ensure your code adheres to the following:
Before submitting any code, run rubocop
to ensure it adheres to our style guidelines.
bundle exec rubocop
If there are any issues, please resolve them before submitting your pull request.
- Ruby Version: Ensure that your code is compatible with Ruby version
>= 3.1.0
. - Rails Version: This project uses Rails
7.x
. Make sure your changes are compatible. - Style: Follow the Ruby community style guide.
- Place any new services in the
lib/ruby_api_pack_cloudways/
folder. - Follow the same structure for methods in service classes and modules, ensuring maintainability across features.
- Keep code DRY (Don’t Repeat Yourself). If something is reusable, refactor it into a shared method or module.
A good commit message provides clarity and context for the changes made. Follow these guidelines for commit messages:
- Use present tense: "Add feature" instead of "Added feature".
- Limit the subject line to 50 characters.
- Provide a detailed description if necessary.
- Reference any related issues by number.
Add provider list fetch functionality for Cloudways API
- Implement `cw_provider_list` method in CwLists class
- Add corresponding tests in `cw_lists_spec.rb`
- Update API connection class to handle new endpoint
Fixes #15
When you're ready to submit your changes, please follow these steps:
Work on a separate branch that describes the feature or fix.
git checkout -b feature/add-provider-list
Ensure all tests pass before submitting your pull request (PR).
bundle exec rspec
When your changes are ready, push your branch to GitHub and open a pull request. Make sure to:
- Provide a descriptive title.
- Reference any related issues.
- Include details of the changes you’ve made and any necessary context.
The maintainers may request changes. Be ready to address them.
Before submitting a PR, ensure the test suite passes. We use RSpec for unit and integration testing. Follow these steps:
Ensure that the test suite runs and passes.
bundle exec rspec
Any new functionality should include corresponding tests. Tests are located in the spec/
folder, and you should follow the structure already in place for:
- Modules: Place new tests in
spec/modules/
. - Services: Place service-related tests in
spec/services/
.
Ensure that your code is well-covered by tests.
If you encounter any bugs or have feature requests, please open an issue. When reporting, please include:
- A clear title and description.
- Steps to reproduce the issue.
- Any relevant logs or error messages.
Please read and follow our Code of Conduct to ensure a welcoming and inclusive environment for everyone.