Thanks for considering contributing to our project! We want to make Stretchy a great tool for integrating Elasticsearch with Ruby projects, and getting help from the community is always appreciated.
- Fork it ( https://github.com/[my-github-username]/stretchy/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Please add a spec to reproduce the bug, fix it, then update any documentation necessary.
If you notice we've got something wrong in the docs, please feel welcome to fix it.
Before adding new features to the query builder, please open a new issue to discuss it. This helps ensure your new feature is in line with the project's goals, and that you don't invest a bunch of time in something we might reject.
Our documentation is far from perfect, but if you add new methods to the query chain (ie, anything in lib/stretchy/clauses) be sure to document that using the YARD syntax, and also add it to the README.
We use rspec for testing, with the latest version of Elasticsearch and Ruby. Until we hit 1.0, no support for older versions of either is planned.
- Use unit tests to ensure basic classes (builders, clauses, etc) behave the way you expect.
- Test the output of
.to_searchto ensure the JSON being generated for Elasticsearch is what you expect. - Write an integration test under
spec/integrationto ensure that using your search terms actually affects the search results.
We run all specs automatically through Solano CI, and specs must pass there before any merge.
The version is only bumped on master after a pull request is merged. We use Semantic Versioning.
- Bug fixes will bump the patch version
- Small new additions will bump the minor version
- Behavior and backwards-incompatible changes will bump the major version
- Use the included
.editorconfigto manage minor style things like indents and tabs-v-spaces. - Generally follow the Github Ruby style guide.
- Rebase your branch and squash commits into reasonable chunks with good commit messages. No
@wiporfix specscommits, please. Here are some guidelines for good commit messages. - Write specs however they make sense to read. Use
describeanditif your test names make a sentence, orcontextandspecifyfor more specific unit tests.