|
| 1 | +# Contributing to Grape-Swagger-Rails |
| 2 | + |
| 3 | +This project is work of [many contributors](https://github.com/BrandyMint/grape-swagger-rails/graphs/contributors). |
| 4 | +You're encouraged to submit [pull requests](https://github.com/BrandyMint/grape-swagger-rails/pulls), |
| 5 | +[propose features and discuss issues](https://github.com/BrandyMint/grape-swagger-rails/issues). |
| 6 | + |
| 7 | +In the examples below, substitute your Github username for `contributor` in URLs. |
| 8 | + |
| 9 | +## Fork the Project |
| 10 | + |
| 11 | +Fork the [project on Github](https://github.com/BrandyMint/grape-swagger-rails) and check out your copy. |
| 12 | + |
| 13 | +``` |
| 14 | +git clone https://github.com/contributor/grape-swagger.git |
| 15 | +cd grape-swagger |
| 16 | +git remote add upstream https://github.com/BrandyMint/grape-swagger-rails.git |
| 17 | +``` |
| 18 | + |
| 19 | +## Create a Topic Branch |
| 20 | + |
| 21 | +Make sure your fork is up-to-date and create a topic branch for your feature or bug fix. |
| 22 | + |
| 23 | +``` |
| 24 | +git checkout master |
| 25 | +git pull upstream master |
| 26 | +git checkout -b my-feature-branch |
| 27 | +``` |
| 28 | + |
| 29 | +## Bundle Install and Test |
| 30 | + |
| 31 | +Ensure that you can build the project and run tests. |
| 32 | + |
| 33 | +``` |
| 34 | +bundle install |
| 35 | +bundle exec rake |
| 36 | +``` |
| 37 | + |
| 38 | +## Write Tests |
| 39 | + |
| 40 | +Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. |
| 41 | +Add to [spec](spec). |
| 42 | + |
| 43 | +We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix. |
| 44 | + |
| 45 | +## Write Code |
| 46 | + |
| 47 | +Implement your feature or bug fix. |
| 48 | + |
| 49 | +Make sure that `bundle exec rake` completes without errors. |
| 50 | + |
| 51 | +You might find it useful to iterate on code by running the test project from spec/dummy. |
| 52 | + |
| 53 | +``` |
| 54 | +spec/dummy$ GRAPE_SWAGGER_VERSION=HEAD bundle install |
| 55 | +
|
| 56 | +Updating git://github.com/tim-vandecasteele/grape-swagger.git |
| 57 | +Fetching gem metadata from https://rubygems.org/......... |
| 58 | +Resolving dependencies... |
| 59 | +... |
| 60 | +
|
| 61 | +spec/dummy$ GRAPE_SWAGGER_VERSION=HEAD rails s |
| 62 | +=> Booting WEBrick |
| 63 | +=> Rails 4.1.8 application starting in development on http://0.0.0.0:3000 |
| 64 | +=> Run `rails server -h` for more startup options |
| 65 | +=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option) |
| 66 | +=> Ctrl-C to shutdown server |
| 67 | +... |
| 68 | +``` |
| 69 | + |
| 70 | +Navigate to http://localhost:3000/swagger. |
| 71 | + |
| 72 | +## Write Documentation |
| 73 | + |
| 74 | +Document any external behavior in the [README](README.md). |
| 75 | + |
| 76 | +## Push |
| 77 | + |
| 78 | +``` |
| 79 | +git push origin my-feature-branch |
| 80 | +``` |
| 81 | + |
| 82 | +## Make a Pull Request |
| 83 | + |
| 84 | +Go to https://github.com/contributor/grape and select your feature branch. |
| 85 | +Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days. |
| 86 | + |
| 87 | +## Rebase |
| 88 | + |
| 89 | +If you've been working on a change for a while, rebase with upstream/master. |
| 90 | + |
| 91 | +``` |
| 92 | +git fetch upstream |
| 93 | +git rebase upstream/master |
| 94 | +git push origin my-feature-branch -f |
| 95 | +``` |
| 96 | + |
| 97 | +## Check on Your Pull Request |
| 98 | + |
| 99 | +Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above. |
| 100 | + |
| 101 | +## Be Patient |
| 102 | + |
| 103 | +It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang on there! |
| 104 | + |
| 105 | +## Thank You |
| 106 | + |
| 107 | +Please do know that we really appreciate and value your time and work. We love you, really. |
0 commit comments