Skip to content

Commit

Permalink
Backported from slack-metabot and slack-shellbot.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Jan 10, 2016
1 parent ea5242c commit 954a5e4
Show file tree
Hide file tree
Showing 102 changed files with 1,786 additions and 700 deletions.
28 changes: 11 additions & 17 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2015-11-14 16:58:19 -0500 using RuboCop version 0.35.0.
# on 2016-01-10 15:28:03 -0500 using RuboCop version 0.35.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 5
# Offense count: 2
Lint/RescueException:
Exclude:
- 'app/slack_bot_server_app.rb'
- 'bot/service.rb'
- 'bot/slack_bot_server.rb'
- 'config.ru'
- 'slack-bot-server/app.rb'

# Offense count: 4
# Offense count: 6
Metrics/AbcSize:
Max: 32

# Offense count: 2
Metrics/CyclomaticComplexity:
Max: 11

# Offense count: 40
# Offense count: 58
# Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength:
Max: 163

# Offense count: 5
# Offense count: 6
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 23
Expand All @@ -35,18 +34,13 @@ Metrics/MethodLength:
Metrics/PerceivedComplexity:
Max: 11

# Offense count: 16
# Offense count: 26
# Configuration parameters: Exclude.
Style/Documentation:
Enabled: false

# Offense count: 1
Style/EachWithObject:
Exclude:
- 'api/helpers/error_helpers.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/Lambda:
# Configuration parameters: Exclude.
Style/FileName:
Exclude:
- 'app/slack_bot_server_app.rb'
- 'slack-bot-server.rb'
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Changelog

* 1/10/2016: Backported changes from slack-metabot and slack-shellbot - [@dblock](https://github.com/dblock).
125 changes: 125 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Contributing to SlackBotServer

This project is work of [many contributors](https://github.com/dblock/slack-bot-server/graphs/contributors).

You're encouraged to submit [pull requests](https://github.com/dblock/slack-bot-server/pulls), [propose features and discuss issues](https://github.com/dblock/slack-bot-server/issues).

In the examples below, substitute your Github username for `contributor` in URLs.

## Fork the Project

Fork the [project on Github](https://github.com/dblock/slack-bot-server) and check out your copy.

```
git clone https://github.com/contributor/slack-bot-server.git
cd slack-bot-server
git remote add upstream https://github.com/dblock/slack-bot-server.git
```

## Create a Topic Branch

Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.

```
git checkout master
git pull upstream master
git checkout -b my-feature-branch
```

## Bundle Install and Test

Ensure that you can build the project and run tests.

```
bundle install
bundle exec rake
```

## Write Tests

Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build.
Add to [spec](spec).

We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.

## Write Code

Implement your feature or bug fix.

Ruby style is enforced with [Rubocop](https://github.com/bbatsov/rubocop).
Run `bundle exec rubocop` and fix any style issues highlighted.

Make sure that `bundle exec rake` completes without errors.

## Write Documentation

Document any external behavior in the [README](README.md).

## Update Changelog

Add a line to [CHANGELOG](CHANGELOG.md) under *Next Release*.
Make it look like every other line, including your name and link to your Github account.

## Commit Changes

Make sure git knows your name and email address:

```
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
```

Writing good commit logs is important. A commit log should describe what changed and why.

```
git add ...
git commit
```

## Push

```
git push origin my-feature-branch
```

## Make a Pull Request

Go to https://github.com/contributor/slack-bot-server and select your feature branch.
Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.

## Rebase

If you've been working on a change for a while, rebase with upstream/master.

```
git fetch upstream
git rebase upstream/master
git push origin my-feature-branch -f
```

## Update CHANGELOG Again

Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.

```
* [#123](https://github.com/dblock/slack-bot-server/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
```

Amend your previous commit and force push the changes.

```
git commit --amend
git push origin my-feature-branch -f
```

## Check on Your Pull Request

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.

## Be Patient

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!

## Thank You

Please do know that we really appreciate and value your time and work. We love you, really.
25 changes: 25 additions & 0 deletions DEBUGGING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Debugging

### Locally

You can debug your instance of slack-bot-server with a built-in `script/console`.

### Silence Mongoid Logger

If Mongoid logging is annoying you.

```ruby
Mongoid.logger.level = Logger::INFO
Mongo::Logger.logger.level = Logger::INFO
```

### Heroku

```
heroku run script/console --app=...
Running `scrupt/console` attached to terminal... up, run.7593
2.2.1 > Team.count
=> 3
```
41 changes: 25 additions & 16 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,42 @@
source 'http://rubygems.org'

gem 'rack'
gem 'grape'
gem 'json'
ruby '2.2.4'

gem 'slack-ruby-bot', '~> 0.6.0'
gem 'mongoid', '~> 5.0.0'
gem 'puma'
gem 'grape', '~> 0.14.0'
gem 'grape-roar'
gem 'rack-cors'
gem 'kaminari', '~> 0.16.1', require: 'kaminari/grape'
gem 'grape-swagger'
gem 'grape-roar'
gem 'mongoid'
gem 'mongoid-scroll'
gem 'slack-ruby-bot', '~> 0.6.0'
gem 'faye-websocket'
gem 'puma'
gem 'rack-robotz'
gem 'newrelic_rpm'
gem 'newrelic-slack-ruby-bot'
gem 'rack-rewrite'
gem 'rack-server-pages'

group :development do
gem 'rake'
gem 'guard'
gem 'guard-bundler'
gem 'guard-rack'
gem 'rubocop', '0.35.0'
group :development, :test do
gem 'rake', '~> 10.4'
gem 'rubocop', '0.35.1'
gem 'foreman'
end

group :development do
gem 'mongoid-shell'
gem 'heroku'
end

group :test do
gem 'rspec'
gem 'rack-test'
gem 'hyperclient'
gem 'database_cleaner'
gem 'webmock'
gem 'vcr'
gem 'fabrication'
gem 'faker'
gem 'database_cleaner'
gem 'hyperclient'
gem 'capybara'
gem 'selenium-webdriver'
end
Loading

0 comments on commit 954a5e4

Please sign in to comment.