We welcome all contributions!
- Ruby version 3.1.1+
There are numerous tasks available to help with development in the Rakefile.
You can also run any of those tasks manually. See each section below.
Run unit tests with bundler exec rspec
To use the linter, install it:
gem install rubocop -v 1.50.2
gem install rubocop-rspec -v 2.20.0
gem install rubocop-performance -v 1.15
To auto-fix formatting, run the following:
rubocop -x
To auto-fix correctable linting errors, run the following:
rubocop -A
To run it as CI would, run:
rubocop
If you use Visual Studio Code, you can use the extension ruby-rubocop to see editor hints.
The project uses RBS for type definitions and Steep for type checking.
RBS comes preinstalled with Ruby version 3+.
Install the required gem:
gem install steep -v 1.6.0
You may find the following tools helpful:
- Steep VSCode plugin provides inline type validation
- RubyMine IDE makes it easier to edit type definitions
- Bump version in
Gemfile.lock
andgrowthbook.gemspec
- Merge to the
main
branch - Create a new GitHub release with the new version as the tag (e.g.
v0.2.0
) - Run
gem build growthbook
- Run
gem push growthbook-{VERSION}.gem