mongoid-danger 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/.rspec +2 -0
- data/.rubocop.yml +10 -0
- data/.rubocop_todo.yml +13 -0
- data/.travis.yml +8 -0
- data/CHANGELOG.md +6 -0
- data/CONTRIBUTING.md +99 -0
- data/Dangerfile +38 -0
- data/Gemfile +5 -0
- data/LICENSE +20 -0
- data/README.md +46 -0
- data/RELEASING.md +65 -0
- data/Rakefile +14 -0
- data/lib/mongoid-danger/version.rb +3 -0
- data/mongoid-danger.gemspec +22 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/version_spec.rb +7 -0
- metadata +119 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ffd2d0c1f74da59df7a094c750d829a0dd8e140b
|
4
|
+
data.tar.gz: 7a0028f45184ac5cbb4e5b61c905811563035111
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e45cb9128d54bcb6f1b61f14396c81bbd9dfa8fd5d79c1584904a89e30cd019b23843e0b3f2e5e257725fb8c09d95b0ef73028f021e5775f9777fa82c0ad81a6
|
7
|
+
data.tar.gz: 7b6a1c6f64b5e151eb950a6d75d87750353f9386b99dc314dcaaeb63f2ec70c05183be807a2b04a8b09a067443db738e9b18b2f7c54c26d41a9bb6330a2a3392
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2016-07-30 11:43:22 -0400 using RuboCop version 0.42.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 18
|
10
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
11
|
+
# URISchemes: http, https
|
12
|
+
Metrics/LineLength:
|
13
|
+
Max: 195
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
### Changelog
|
2
|
+
|
3
|
+
### 0.1.0 (9/5/2016)
|
4
|
+
|
5
|
+
* [#3](https://github.com/mongoid/danger/pull/3): Initial public release as a gem for Danger 3.2.1 - [@dblock](https://github.com/dblock).
|
6
|
+
* [#1](https://github.com/mongoid/danger/pull/1): Upgraded Danger to 3.0 - [@dblock](https://github.com/dblock).
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
Contributing to Mongoid's Dangerfile
|
2
|
+
====================================
|
3
|
+
|
4
|
+
You're encouraged to submit [pull requests](https://github.com/mongoid/danger/pulls), [propose features and discuss issues](https://github.com/mongoid/danger/issues).
|
5
|
+
|
6
|
+
#### Fork the Project
|
7
|
+
|
8
|
+
Fork the [project on Github](https://github.com/mongoid/danger) and check out your copy.
|
9
|
+
|
10
|
+
```
|
11
|
+
git clone https://github.com/contributor/danger.git
|
12
|
+
cd danger
|
13
|
+
git remote add upstream https://github.com/mongoid/danger.git
|
14
|
+
```
|
15
|
+
|
16
|
+
#### Create a Topic Branch
|
17
|
+
|
18
|
+
Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
|
19
|
+
|
20
|
+
```
|
21
|
+
git checkout master
|
22
|
+
git pull upstream master
|
23
|
+
git checkout -b my-feature-branch
|
24
|
+
```
|
25
|
+
|
26
|
+
#### Update Dangerfile
|
27
|
+
|
28
|
+
Implement your feature in Dangerfile.
|
29
|
+
|
30
|
+
Ruby style is enforced with [Rubocop](https://github.com/bbatsov/rubocop), run `bundle exec rubocop -a`, then `bundle exec rubocop` and fix any style issues highlighted.
|
31
|
+
|
32
|
+
Make sure that `bundle exec rake` completes without errors.
|
33
|
+
|
34
|
+
#### Update Changelog
|
35
|
+
|
36
|
+
Add a line to [CHANGELOG](CHANGELOG.md). Make it look like every other line, including your name and link to your Github account.
|
37
|
+
|
38
|
+
#### Commit Changes
|
39
|
+
|
40
|
+
Make sure git knows your name and email address:
|
41
|
+
|
42
|
+
```
|
43
|
+
git config --global user.name "Your Name"
|
44
|
+
git config --global user.email "contributor@example.com"
|
45
|
+
```
|
46
|
+
|
47
|
+
Writing good commit logs is important. A commit log should describe what changed and why.
|
48
|
+
|
49
|
+
```
|
50
|
+
git add ...
|
51
|
+
git commit
|
52
|
+
```
|
53
|
+
|
54
|
+
#### Push
|
55
|
+
|
56
|
+
```
|
57
|
+
git push origin my-feature-branch
|
58
|
+
```
|
59
|
+
|
60
|
+
#### Make a Pull Request
|
61
|
+
|
62
|
+
Go to https://github.com/contributor/danger and select your feature branch. Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
|
63
|
+
|
64
|
+
#### Rebase
|
65
|
+
|
66
|
+
If you've been working on a change for a while, rebase with upstream/master.
|
67
|
+
|
68
|
+
```
|
69
|
+
git fetch upstream
|
70
|
+
git rebase upstream/master
|
71
|
+
git push origin my-feature-branch -f
|
72
|
+
```
|
73
|
+
|
74
|
+
#### Update CHANGELOG Again
|
75
|
+
|
76
|
+
Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.
|
77
|
+
|
78
|
+
```
|
79
|
+
* [#123](https://github.com/mongoid/danger/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
|
80
|
+
```
|
81
|
+
|
82
|
+
Amend your previous commit and force push the changes.
|
83
|
+
|
84
|
+
```
|
85
|
+
git commit --amend
|
86
|
+
git push origin my-feature-branch -f
|
87
|
+
```
|
88
|
+
|
89
|
+
#### Check on Your Pull Request
|
90
|
+
|
91
|
+
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.
|
92
|
+
|
93
|
+
#### Be Patient
|
94
|
+
|
95
|
+
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!
|
96
|
+
|
97
|
+
#### Thank You
|
98
|
+
|
99
|
+
Please do know that we really appreciate and value your time and work. We love you, really.
|
data/Dangerfile
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# --------------------------------------------------------------------------------------------------------------------
|
2
|
+
# Has any changes happened inside the actual library code?
|
3
|
+
# --------------------------------------------------------------------------------------------------------------------
|
4
|
+
has_app_changes = !git.modified_files.grep(/lib/).empty?
|
5
|
+
has_spec_changes = !git.modified_files.grep(/spec/).empty?
|
6
|
+
|
7
|
+
# --------------------------------------------------------------------------------------------------------------------
|
8
|
+
# You've made changes to lib, but didn't write any tests?
|
9
|
+
# --------------------------------------------------------------------------------------------------------------------
|
10
|
+
if has_app_changes && !has_spec_changes
|
11
|
+
warn("There're library changes, but not tests. That's OK as long as you're refactoring existing code.", sticky: false)
|
12
|
+
end
|
13
|
+
|
14
|
+
# --------------------------------------------------------------------------------------------------------------------
|
15
|
+
# You've made changes to specs, but no library code has changed?
|
16
|
+
# --------------------------------------------------------------------------------------------------------------------
|
17
|
+
if !has_app_changes && has_spec_changes
|
18
|
+
message('We really appreciate pull requests that demonstrate issues, even without a fix. That said, the next step is to try and fix the failing tests!', sticky: false)
|
19
|
+
end
|
20
|
+
|
21
|
+
# --------------------------------------------------------------------------------------------------------------------
|
22
|
+
# Have you updated CHANGELOG.md?
|
23
|
+
# --------------------------------------------------------------------------------------------------------------------
|
24
|
+
changelog.check
|
25
|
+
|
26
|
+
# --------------------------------------------------------------------------------------------------------------------
|
27
|
+
# Don't let testing shortcuts get into master by accident,
|
28
|
+
# ensuring that we don't get green builds based on a subset of tests.
|
29
|
+
# --------------------------------------------------------------------------------------------------------------------
|
30
|
+
|
31
|
+
(git.modified_files + git.added_files - %w(Dangerfile)).each do |file|
|
32
|
+
next unless File.file?(file)
|
33
|
+
contents = File.read(file)
|
34
|
+
if file.start_with?('spec')
|
35
|
+
fail("`xit` or `fit` left in tests (#{file})") if contents =~ /^\w*[xf]it/
|
36
|
+
fail("`fdescribe` left in tests (#{file})") if contents =~ /^\w*fdescribe/
|
37
|
+
end
|
38
|
+
end
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2016 Daniel Doubrovkine and Contributors.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
## Danger
|
2
|
+
|
3
|
+
[Danger](http://danger.systems) runs during Mongoid projects' CI process, and gives you a chance to automate common code review chores.
|
4
|
+
|
5
|
+
[![Build Status](https://travis-ci.org/mongoid/danger.svg?branch=master)](https://travis-ci.org/mongoid/danger)
|
6
|
+
|
7
|
+
### Setup
|
8
|
+
|
9
|
+
Enable Danger for a project within the [mongoid organization](https://github.com/mongoid). This involves adding a token in Travis-CI and making some build script changes. See [mongoid-compatibility#3](https://github.com/mongoid/mongoid-compatibility/pull/3) for a complete example.
|
10
|
+
|
11
|
+
#### Set DANGER_GITHUB_API_TOKEN in Travis-CI
|
12
|
+
|
13
|
+
In Travis-CI, choose _Settings_ and add `DANGER_GITHUB_API_TOKEN` in _Environment Variables_. Tick the _Display value in build log_ option to enable Danger in pull requests. Set the value to the API key for the [mongoid-bot](https://github.com/mongoid-bot) user, look in a recent build for this project for its value.
|
14
|
+
|
15
|
+
#### Add Danger to Gemfile
|
16
|
+
|
17
|
+
Add `mongoid-danger` to `Gemfile`.
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem 'mongoid-danger', '~> 0.1.0', require: false
|
21
|
+
```
|
22
|
+
|
23
|
+
#### Add Dangerfile
|
24
|
+
|
25
|
+
Commit a `Dangerfile`, eg. [mongoid-compatibility's Dangerfile](https://github.com/mongoid/mongoid-compatibility/blob/master/Dangerfile).
|
26
|
+
|
27
|
+
#### Add Danger to Travis-CI
|
28
|
+
|
29
|
+
Add Danger to `.travis.yml`, eg. [mongoid-compatibility's Travis.yml](https://github.com/mongoid/mongoid-compatibility/blob/master/.travis.yml).
|
30
|
+
|
31
|
+
```yaml
|
32
|
+
matrix:
|
33
|
+
include:
|
34
|
+
- rvm: 2.3.1
|
35
|
+
script:
|
36
|
+
- bundle exec danger
|
37
|
+
```
|
38
|
+
|
39
|
+
#### Commit via a Pull Request
|
40
|
+
|
41
|
+
To test things out, make a pull request without CHANGELOG.md changes. Iterate until green.
|
42
|
+
|
43
|
+
## License
|
44
|
+
|
45
|
+
MIT License. See [LICENSE](LICENSE) for details.
|
46
|
+
|
data/RELEASING.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# Releasing
|
2
|
+
|
3
|
+
There're no particular rules about when to release mongoid-danger. Release bug fixes frequenty, features not so frequently and breaking API changes rarely.
|
4
|
+
|
5
|
+
### Release
|
6
|
+
|
7
|
+
Run tests, check that all tests succeed locally.
|
8
|
+
|
9
|
+
```
|
10
|
+
bundle install
|
11
|
+
rake
|
12
|
+
```
|
13
|
+
|
14
|
+
Check that the last build succeeded in [Travis CI](https://travis-ci.org/mongoid/mongoid-danger) for all supported platforms.
|
15
|
+
|
16
|
+
Increment the version, modify [lib/mongoid-danger/version.rb](lib/mongoid-danger/version.rb).
|
17
|
+
|
18
|
+
* Increment the third number if the release has bug fixes and/or very minor features, only (eg. change `0.7.1` to `0.7.2`).
|
19
|
+
* Increment the second number if the release contains major features or breaking API changes (eg. change `0.7.1` to `0.8.0`).
|
20
|
+
|
21
|
+
Change "Next Release" in [CHANGELOG.md](CHANGELOG.md) to the new version.
|
22
|
+
|
23
|
+
```
|
24
|
+
### 0.7.2 (February 6, 2014)
|
25
|
+
```
|
26
|
+
|
27
|
+
Remove the line with "Your contribution here.", since there will be no more contributions to this release.
|
28
|
+
|
29
|
+
Commit your changes.
|
30
|
+
|
31
|
+
```
|
32
|
+
git add CHANGELOG.md lib/mongoid-danger/version.rb
|
33
|
+
git commit -m "Preparing for release, 0.7.2."
|
34
|
+
git push origin master
|
35
|
+
```
|
36
|
+
|
37
|
+
Release.
|
38
|
+
|
39
|
+
```
|
40
|
+
$ rake release
|
41
|
+
|
42
|
+
mongoid-danger 0.7.2 built to pkg/mongoid-danger-0.7.2.gem.
|
43
|
+
Tagged v0.7.2.
|
44
|
+
Pushed git commits and tags.
|
45
|
+
Pushed mongoid-danger 0.7.2 to rubygems.org.
|
46
|
+
```
|
47
|
+
|
48
|
+
### Prepare for the Next Version
|
49
|
+
|
50
|
+
Add the next release to [CHANGELOG.md](CHANGELOG.md).
|
51
|
+
|
52
|
+
```
|
53
|
+
Next Release
|
54
|
+
============
|
55
|
+
|
56
|
+
* Your contribution here.
|
57
|
+
```
|
58
|
+
|
59
|
+
Comit your changes.
|
60
|
+
|
61
|
+
```
|
62
|
+
git add CHANGELOG.md
|
63
|
+
git commit -m "Preparing for next release."
|
64
|
+
git push origin master
|
65
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
|
4
|
+
Bundler.setup :default
|
5
|
+
|
6
|
+
Bundler::GemHelper.install_tasks
|
7
|
+
|
8
|
+
require 'rubocop/rake_task'
|
9
|
+
RuboCop::RakeTask.new
|
10
|
+
|
11
|
+
require 'rspec/core/rake_task'
|
12
|
+
RSpec::Core::RakeTask.new(:spec)
|
13
|
+
|
14
|
+
task default: [:rubocop, :spec]
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'mongoid-danger/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'mongoid-danger'
|
7
|
+
s.version = MongoidDanger::VERSION
|
8
|
+
s.authors = ['dblock']
|
9
|
+
s.email = ['dblock@dblock.org']
|
10
|
+
s.homepage = 'https://github.com/mongoid/danger'
|
11
|
+
s.summary = 'Danger.systems conventions for mongoid projects.'
|
12
|
+
s.description = 'Packages a Dangerfile to be used with Danger for projects within the Mongoid community.'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.require_paths = ['lib']
|
17
|
+
|
18
|
+
s.add_development_dependency 'rake'
|
19
|
+
s.add_development_dependency 'rspec'
|
20
|
+
s.add_runtime_dependency 'danger', '~> 3.2.1'
|
21
|
+
s.add_runtime_dependency 'danger-changelog', '~> 0.1.0'
|
22
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mongoid-danger
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- dblock
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-09-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: danger
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.2.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.2.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: danger-changelog
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.1.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.1.0
|
69
|
+
description: Packages a Dangerfile to be used with Danger for projects within the
|
70
|
+
Mongoid community.
|
71
|
+
email:
|
72
|
+
- dblock@dblock.org
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- ".rspec"
|
79
|
+
- ".rubocop.yml"
|
80
|
+
- ".rubocop_todo.yml"
|
81
|
+
- ".travis.yml"
|
82
|
+
- CHANGELOG.md
|
83
|
+
- CONTRIBUTING.md
|
84
|
+
- Dangerfile
|
85
|
+
- Gemfile
|
86
|
+
- LICENSE
|
87
|
+
- README.md
|
88
|
+
- RELEASING.md
|
89
|
+
- Rakefile
|
90
|
+
- lib/mongoid-danger/version.rb
|
91
|
+
- mongoid-danger.gemspec
|
92
|
+
- spec/spec_helper.rb
|
93
|
+
- spec/version_spec.rb
|
94
|
+
homepage: https://github.com/mongoid/danger
|
95
|
+
licenses: []
|
96
|
+
metadata: {}
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.4.8
|
114
|
+
signing_key:
|
115
|
+
specification_version: 4
|
116
|
+
summary: Danger.systems conventions for mongoid projects.
|
117
|
+
test_files:
|
118
|
+
- spec/spec_helper.rb
|
119
|
+
- spec/version_spec.rb
|