Skip to content

Commit

Permalink
Merge pull request #1347 from activerecord-hackery/improve-contributing
Browse files Browse the repository at this point in the history
Improve CONTRIBUTING.md
  • Loading branch information
deivid-rodriguez authored Jun 13, 2022
2 parents 9b0aefc + 3569bd7 commit b8ec00e
Showing 1 changed file with 32 additions and 10 deletions.
42 changes: 32 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,51 @@ Here's a quick guide:
4. Begin by running the tests. We only take pull requests with passing tests,
and it's great to know that you have a clean slate:

$ bundle exec rake spec
```sh
bundle exec rake spec
```

The test suite runs by default with SQLite3. To run the test suite with PostgreSQL or MySQL, use:

$ DB=pg bundle exec rake spec (`DB=postgres` & `DB=postgresql` work too)
$ DB=mysql bundle exec rake spec
```sh
DB=pg bundle exec rake spec
DB=mysql bundle exec rake spec
```

A one-liner to run all three

```sh
bundle exec rake spec && DB=pg bundle exec rake spec && DB=mysql bundle exec rake spec
```

For Postgres and MySQL, databases are expected to exist, called 'ransack'. To create use these commands (assuming OS X and Homebrew):

### Postgres
$ createdb ransack

```sh
createdb ransack
```

### MySQL
$ mysql -u root
mysql> create database ransack;

```sh
mysql -u root
mysql> create database ransack;
```

The test suite runs by default

To run only the tests in a particular file: `bundle exec rspec <path/to/filename>`

$ bundle exec rspec spec/ransack/search_spec.rb
```sh
bundle exec rspec spec/ransack/search_spec.rb
```

To run a single test in that file: `bundle exec rspec <path/to/filename> -e "test name"`

$ bundle exec rspec spec/ransack/search_spec.rb -e "accepts a context option"
```sh
bundle exec rspec spec/ransack/search_spec.rb -e "accepts a context option"
```

5. Hack away! Please use Ruby features that are compatible down to Ruby 2.3.
Since version 2.3.1, Ransack no longer maintains Ruby 2.2 compatibility.
Expand All @@ -109,8 +129,10 @@ Here's a quick guide:

9. Make sure git knows your name and email address in your `~/.gitconfig` file:

$ git config --global user.name "Your Name"
$ git config --global user.email "contributor@example.com"
```sh
git config --global user.name "Your Name"
git config --global user.email "contributor@example.com"
```

10. Commit your changes (`git commit -am 'Add feature/fix bug/improve docs'`).
If your pull request only contains documentation changes, please remember
Expand Down

0 comments on commit b8ec00e

Please sign in to comment.