A Slack Bot that pulls Pixiv information and posts the full image(s) into Slack, with iOS shortcuts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
3.7 KiB

9 years ago
  1. # Contributing to SlackRubyBot
  2. This project is work of [many contributors](https://github.com/dblock/slack-ruby-bot/graphs/contributors).
  3. You're encouraged to submit [pull requests](https://github.com/dblock/slack-ruby-bot/pulls), [propose features and discuss issues](https://github.com/dblock/slack-ruby-bot/issues).
  4. In the examples below, substitute your Github username for `contributor` in URLs.
  5. ## Fork the Project
  6. Fork the [project on Github](https://github.com/dblock/slack-ruby-bot) and check out your copy.
  7. ```
  8. git clone https://github.com/contributor/slack-ruby-bot.git
  9. cd slack-ruby-bot
  10. git remote add upstream https://github.com/dblock/slack-ruby-bot.git
  11. ```
  12. ## Bundle Install and Test
  13. Ensure that you can build the project and run tests.
  14. ```
  15. bundle install
  16. bundle exec rake
  17. ```
  18. ## Run SlackRubyBot in Development
  19. Create a private slack group for yourself.
  20. Create a new Bot Integration under [services/new/bot](http://slack.com/services/new/bot).
  21. ![](screenshots/register-bot.png)
  22. On the next screen, note the API token.
  23. Run `SLACK_API_TOKEN=<your API token> foreman start`.
  24. You can also create a `.env` file with `SLACK_API_TOKEN=<your API token>` and just run `foreman start`.
  25. ## Create a Topic Branch
  26. Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
  27. ```
  28. git checkout master
  29. git pull upstream master
  30. git checkout -b my-feature-branch
  31. ```
  32. ## Write Tests
  33. Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build.
  34. Add to [spec](spec).
  35. We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.
  36. ## Write Code
  37. Implement your feature or bug fix.
  38. Ruby style is enforced with [Rubocop](https://github.com/bbatsov/rubocop).
  39. Run `bundle exec rubocop` and fix any style issues highlighted.
  40. Make sure that `bundle exec rake` completes without errors.
  41. ## Write Documentation
  42. Document any external behavior in the [README](README.md).
  43. ## Update Changelog
  44. Add a line to [CHANGELOG](CHANGELOG.md) under *Next Release*.
  45. Make it look like every other line, including your name and link to your Github account.
  46. ## Commit Changes
  47. Make sure git knows your name and email address:
  48. ```
  49. git config --global user.name "Your Name"
  50. git config --global user.email "contributor@example.com"
  51. ```
  52. Writing good commit logs is important. A commit log should describe what changed and why.
  53. ```
  54. git add ...
  55. git commit
  56. ```
  57. ## Push
  58. ```
  59. git push origin my-feature-branch
  60. ```
  61. ## Make a Pull Request
  62. Go to https://github.com/contributor/slack-ruby-bot and select your feature branch.
  63. Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
  64. ## Rebase
  65. If you've been working on a change for a while, rebase with upstream/master.
  66. ```
  67. git fetch upstream
  68. git rebase upstream/master
  69. git push origin my-feature-branch -f
  70. ```
  71. ## Update CHANGELOG Again
  72. Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.
  73. ```
  74. * [#123](https://github.com/dblock/slack-ruby-bot/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
  75. ```
  76. Amend your previous commit and force push the changes.
  77. ```
  78. git commit --amend
  79. git push origin my-feature-branch -f
  80. ```
  81. ## Check on Your Pull Request
  82. 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.
  83. ## Be Patient
  84. 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!
  85. ## Thank You
  86. Please do know that we really appreciate and value your time and work. We love you, really.