Contributions to Cequel are highly welcome! Here's a quick guide.
- Fork the repo and create a topic branch
- Set up your environment and run the tests. The easiest way to do this is to
use Docker; see below. For those who already have a suitable Cassandra
instance running locally:
rake test
- Add tests for your change.
- Make the tests pass.
- Push to your topic branch and submit a pull request.
- Do write tests. If you don't test your patch, I'll have to write tests for it, which is likely to delay the pull request getting accepted.
- Do write documentation for new functionality and update documentation for
changed functionality. Cequel uses
YARD for
documentation. If you're adding a significant new feature, update the
README
too. - Do use code style consistent with the project. Cequel by and large follows the Ruby Style Guide.
- Don't make changes to the
cequel.gemspec
orversion.rb
files, except to add new dependencies in the former.
Install Docker first, then run tests:
git clone [email protected]:yourname/cequel.git
cd cequel
git remote add upstream [email protected]:cequel/cequel.git
bundle install
bundle exec rake test
Cequel's test suite runs against a live Cassandra instance. The easiest way to
get one is to use Docker, docker run --rm -p 9042:9042 cassandra
.
You can configure the cequel test suite to use a different port by setting the CEQUEL_TEST_PORT
environment variable. Example:
docker run --rm -p 33333:9042 cassandra
in one terminalrake test CEQUEL_TEST_PORT=33333
in another termainal
Cequel is tested against a large range of Ruby, Rails, and Cassandra
versions; for most patches, you can just run the tests using the
latest version of all of them. If you're messing with the
Cequel::Schema
or Cequel::Type
modules, you'll want to test at
least against the first and latest releases of 2.1, 2.2 and 3 series.
THANK YOU!