badgerbadgerbadger 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/DESC.md +3 -1
- data/Gemfile +1 -1
- data/README.md +4 -3
- data/badger.gemspec +1 -2
- data/config/services.yaml +1 -1
- data/features/badger.feature +1 -1
- data/features/png.feature +1 -1
- data/features/pulls-and-issues.feature +20 -0
- data/features/services.feature +2 -2
- data/features/ssh-remote.feature +1 -1
- data/features/support/env.rb +0 -1
- data/lib/badger/badger.rb +8 -2
- data/lib/badger/cli.rb +5 -1
- data/lib/badger/version.rb +1 -1
- data/spec/badger_spec.rb +24 -23
- data/spec/spec_helper.rb +1 -2
- metadata +7 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbd62a6fc57354d6db0b17d6a13558b59775b511
|
4
|
+
data.tar.gz: 725aefc31743191a02d1d194ca47c110b08a28f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e5f8424ccbd01385669ceeb1f76d61975cc429b42cff377bf5a8d431e12fe5fa43964e0b9f3af63e33f0083d8149e6dec29cf4f07813bae478c9e868e22f7cc
|
7
|
+
data.tar.gz: 1fefd4d697d24ba60f6536d2f3cb177fab180d287b65d54796f5cb88a27e37960dd5a77e5b210a01782ebf34930d88383dddd0a66678a340cbad89de7553404b
|
data/.travis.yml
CHANGED
data/DESC.md
CHANGED
@@ -24,4 +24,6 @@ And if a license file is found, a License Badge will be generated. Currently sup
|
|
24
24
|
|
25
25
|
* GPL-3
|
26
26
|
|
27
|
-
The supported license details are in `https://github.com/badges/badgerbadgerbadger/blob/master/config/licenses.yaml`, if you're using a different license, send a PR! And if your gemspec license conflicts with your LICENSE file, you should probably fix that.
|
27
|
+
The supported license details are in `https://github.com/badges/badgerbadgerbadger/blob/master/config/licenses.yaml`, if you're using a different license, send a PR! And if your gemspec license conflicts with your LICENSE file, you should probably fix that.
|
28
|
+
|
29
|
+
Use the `--pulls` flag to add badges for open Github issues and pull-requests.
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
[](https://waffle.io/badges/badgerbadgerbadger)
|
2
|
+
[](https://travis-ci.org/badges/badgerbadgerbadger)
|
2
3
|
[](https://gemnasium.com/badges/badgerbadgerbadger)
|
3
4
|
[](https://coveralls.io/r/badges/badgerbadgerbadger)
|
4
5
|
[](https://codeclimate.com/github/badges/badgerbadgerbadger)
|
@@ -24,13 +25,13 @@ or add it to your Gemfile
|
|
24
25
|
Then
|
25
26
|
|
26
27
|
badger badge
|
27
|
-
[](https://travis-ci.org/doge/wow)
|
28
29
|
[](https://gemnasium.com/doge/wow)
|
29
30
|
[](https://coveralls.io/r/doge/wow)
|
30
31
|
[](https://codeclimate.com/github/doge/wow)
|
31
32
|
[](https://rubygems.org/gems/suchgem)
|
32
33
|
[](http://doge.mit-license.org)
|
33
|
-
[](
|
34
|
+
[](https://github.com/badges/badgerbadgerbadger)
|
34
35
|
|
35
36
|
ready to paste into the top of your README (with the correct URLs for your repo)
|
36
37
|
|
data/badger.gemspec
CHANGED
@@ -22,8 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
24
24
|
spec.add_development_dependency 'rake', '~> 10.1'
|
25
|
-
spec.add_development_dependency 'rspec', '~>
|
26
|
-
spec.add_development_dependency 'rspec-pride', '~> 2.3'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 3'
|
27
26
|
spec.add_development_dependency 'cucumber', '~> 1.3'
|
28
27
|
spec.add_development_dependency 'aruba', '~> 0.5'
|
29
28
|
spec.add_development_dependency 'guard', '~> 2.3'
|
data/config/services.yaml
CHANGED
data/features/badger.feature
CHANGED
@@ -8,7 +8,7 @@ Feature: Badge robot
|
|
8
8
|
When I successfully run `badger badge /tmp/wow_repo`
|
9
9
|
Then the output should contain:
|
10
10
|
"""
|
11
|
-
[](https://travis-ci.org/doge/wow)
|
12
12
|
[](https://gemnasium.com/doge/wow)
|
13
13
|
[](https://coveralls.io/r/doge/wow)
|
14
14
|
[](https://codeclimate.com/github/doge/wow)
|
data/features/png.feature
CHANGED
@@ -8,7 +8,7 @@ Feature: Badge robot
|
|
8
8
|
When I successfully run `badger badge /tmp/wow_repo --png `
|
9
9
|
Then the output should contain:
|
10
10
|
"""
|
11
|
-
[](https://travis-ci.org/doge/wow)
|
12
12
|
[](https://gemnasium.com/doge/wow)
|
13
13
|
[](https://coveralls.io/r/doge/wow)
|
14
14
|
[](https://codeclimate.com/github/doge/wow)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Feature: Github issues and PRs
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given git remote is "https://github.com/doge/wow"
|
5
|
+
|
6
|
+
@travis @gemnasium @coveralls @gemspec @mit
|
7
|
+
Scenario: One with everything
|
8
|
+
When I successfully run `badger badge --pulls /tmp/wow_repo`
|
9
|
+
Then the output should contain:
|
10
|
+
"""
|
11
|
+
[](https://travis-ci.org/doge/wow)
|
12
|
+
[](https://gemnasium.com/doge/wow)
|
13
|
+
[](https://coveralls.io/r/doge/wow)
|
14
|
+
[](https://codeclimate.com/github/doge/wow)
|
15
|
+
[](https://github.com/doge/wow/issues)
|
16
|
+
[](https://github.com/doge/wow/pulls)
|
17
|
+
[](https://rubygems.org/gems/suchgem)
|
18
|
+
[](http://doge.mit-license.org)
|
19
|
+
[](https://github.com/badges/badgerbadgerbadger)
|
20
|
+
"""
|
data/features/services.feature
CHANGED
@@ -8,7 +8,7 @@ Feature: Get service badges
|
|
8
8
|
When I successfully run `badger badge /tmp/wow_repo`
|
9
9
|
Then the output should contain:
|
10
10
|
"""
|
11
|
-
[](https://travis-ci.org/doge/wow)
|
12
12
|
"""
|
13
13
|
And the output should not contain:
|
14
14
|
"""
|
@@ -50,4 +50,4 @@ Feature: Get service badges
|
|
50
50
|
Then the output should contain:
|
51
51
|
"""
|
52
52
|
[](https://codeclimate.com/github/doge/wow)
|
53
|
-
"""
|
53
|
+
"""
|
data/features/ssh-remote.feature
CHANGED
@@ -8,7 +8,7 @@ Feature: Badge robot
|
|
8
8
|
When I successfully run `badger badge /tmp/wow_repo`
|
9
9
|
Then the output should contain:
|
10
10
|
"""
|
11
|
-
[](https://travis-ci.org/doge/wow)
|
12
12
|
[](https://gemnasium.com/doge/wow)
|
13
13
|
[](https://coveralls.io/r/doge/wow)
|
14
14
|
[](https://codeclimate.com/github/doge/wow)
|
data/features/support/env.rb
CHANGED
data/lib/badger/badger.rb
CHANGED
@@ -15,7 +15,13 @@ module Badger
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def add service
|
18
|
-
|
18
|
+
if service == 'issues'
|
19
|
+
self << Badger.badge('Github Issues', "http://githubbadges.herokuapp.com/#{github_slug}/issues", "https://github.com/#{github_slug}/issues")
|
20
|
+
elsif service == 'pulls'
|
21
|
+
self << Badger.badge('Pending Pull-Requests', "http://githubbadges.herokuapp.com/#{github_slug}/pulls", "https://github.com/#{github_slug}/pulls")
|
22
|
+
else
|
23
|
+
self << Service.badge(service, github_slug)
|
24
|
+
end
|
19
25
|
self.delete nil
|
20
26
|
end
|
21
27
|
|
@@ -49,4 +55,4 @@ module Badger
|
|
49
55
|
s
|
50
56
|
end
|
51
57
|
end
|
52
|
-
end
|
58
|
+
end
|
data/lib/badger/cli.rb
CHANGED
@@ -13,6 +13,7 @@ module Badger
|
|
13
13
|
desc 'badge', 'Generate badge markdown'
|
14
14
|
long_desc File.read File.join File.dirname( __FILE__), '..', '..', 'DESC.md'
|
15
15
|
method_option :png, :type => :boolean, :default => false, :desc => 'Generate PNG badges instead of the default SVG (because sometimes Github does caching things)'
|
16
|
+
method_option :pulls, :type => :boolean, :default => false, :desc => 'Generate Github pull-request and issue-count badges'
|
16
17
|
|
17
18
|
def badge dir = '.'
|
18
19
|
@badger = Badger.new Badger.git_remote dir
|
@@ -24,6 +25,9 @@ module Badger
|
|
24
25
|
@badger.add 'coveralls' if Badger.has_coveralls? dir
|
25
26
|
@badger.add 'codeclimate' if @badger.any?
|
26
27
|
|
28
|
+
@badger.add 'issues' if options[:pulls]
|
29
|
+
@badger.add 'pulls' if options[:pulls]
|
30
|
+
|
27
31
|
if gemspec_params = Badger.search_gemspec(dir)
|
28
32
|
@badger.rubygem gemspec_params[:rubygem]
|
29
33
|
if gemspec_params[:licenses]
|
@@ -43,4 +47,4 @@ module Badger
|
|
43
47
|
|
44
48
|
default_task :badge
|
45
49
|
end
|
46
|
-
end
|
50
|
+
end
|
data/lib/badger/version.rb
CHANGED
data/spec/badger_spec.rb
CHANGED
@@ -12,83 +12,83 @@ module Badger
|
|
12
12
|
|
13
13
|
context 'initialisation' do
|
14
14
|
it 'should have no badges by default' do
|
15
|
-
@badger.length.
|
15
|
+
expect(@badger.length).to eq 0
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
context 'get the user and repo' do
|
20
20
|
it 'extracts from an https url' do
|
21
|
-
@badger.github_slug.
|
21
|
+
expect(@badger.github_slug).to eq ('doge/wow')
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'extracts the owner' do
|
25
|
-
@badger.owner.
|
25
|
+
expect(@badger.owner).to eq 'doge'
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'extracts from an ssh url' do
|
29
29
|
@badger = Badger.new "git@github.com:doge/wow.git"
|
30
|
-
@badger.github_slug.
|
30
|
+
expect(@badger.github_slug).to eq ('doge/wow')
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'knows that sometimes an https url has a .git suffix because REASONS' do
|
34
34
|
@badger = Badger.new "https://github.com/doge/wow.git"
|
35
|
-
@badger.github_slug.
|
35
|
+
expect(@badger.github_slug).to eq ('doge/wow')
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
39
|
context 'service badges' do
|
40
40
|
it 'should have a travis badge' do
|
41
41
|
@badger.add 'travis'
|
42
|
-
@badger[0].
|
42
|
+
expect(@badger[0]).to eq "[](https://travis-ci.org/doge/wow)"
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'should have a travis badge and a gemnasium badge' do
|
46
46
|
@badger.add 'travis'
|
47
47
|
@badger.add 'gemnasium'
|
48
|
-
@badger[0].
|
49
|
-
@badger[1].
|
50
|
-
@badger.length.
|
48
|
+
expect(@badger[0]).to eq "[](https://travis-ci.org/doge/wow)"
|
49
|
+
expect(@badger[1]).to eq "[](https://gemnasium.com/doge/wow)"
|
50
|
+
expect(@badger.length).to eq 2
|
51
51
|
end
|
52
52
|
|
53
53
|
it 'should handle an unknown service gracefully' do
|
54
54
|
@badger.add 'doge-service'
|
55
|
-
@badger.length.
|
55
|
+
expect(@badger.length).to eq 0
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
59
|
context 'licenses' do
|
60
60
|
it 'should generate an MIT badge' do
|
61
61
|
@badger.license 'mit'
|
62
|
-
@badger[0].
|
62
|
+
expect(@badger[0]).to eq "[](http://doge.mit-license.org)"
|
63
63
|
end
|
64
64
|
|
65
65
|
it 'should generate an Apache badge' do
|
66
66
|
@badger.license 'apache'
|
67
|
-
@badger[0].
|
67
|
+
expect(@badger[0]).to eq "[](http://www.apache.org/licenses/LICENSE-2.0.html)"
|
68
68
|
end
|
69
69
|
|
70
70
|
it 'should generate a GPL3 badge' do
|
71
71
|
@badger.license 'gpl-3.0'
|
72
|
-
@badger[0].
|
72
|
+
expect(@badger[0]).to eq "[](http://www.gnu.org/licenses/gpl-3.0.html)"
|
73
73
|
end
|
74
74
|
|
75
75
|
it 'should be fine with multiple licenses' do
|
76
76
|
@badger.license 'mit'
|
77
77
|
@badger.license 'apache'
|
78
|
-
@badger[0].
|
79
|
-
@badger[1].
|
78
|
+
expect(@badger[0]).to eq "[](http://doge.mit-license.org)"
|
79
|
+
expect(@badger[1]).to eq "[](http://www.apache.org/licenses/LICENSE-2.0.html)"
|
80
80
|
end
|
81
81
|
|
82
82
|
it 'should generate nothing for an unknown license' do
|
83
83
|
@badger.license 'doge-license'
|
84
|
-
@badger.length.
|
84
|
+
expect(@badger.length).to eq 0
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
88
|
context 'rubygems' do
|
89
89
|
it 'should have a rubygems badge' do
|
90
90
|
@badger.rubygem 'suchgem'
|
91
|
-
@badger[0].
|
91
|
+
expect(@badger[0]).to eq "[](https://rubygems.org/gems/suchgem)"
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -97,7 +97,7 @@ module Badger
|
|
97
97
|
@badger.add 'travis'
|
98
98
|
@badger.add 'coveralls'
|
99
99
|
@badger.bonus
|
100
|
-
@badger[2].
|
100
|
+
expect(@badger[2]).to eq "[](https://github.com/badges/badgerbadgerbadger)"
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
@@ -106,24 +106,25 @@ module Badger
|
|
106
106
|
@badger.add 'travis'
|
107
107
|
@badger.add 'codeclimate'
|
108
108
|
@badger.license 'mit'
|
109
|
-
@badger.to_s.
|
110
|
-
%{[.to eq(
|
110
|
+
%{[](https://travis-ci.org/doge/wow)
|
111
111
|
[](https://codeclimate.com/github/doge/wow)
|
112
112
|
[](http://doge.mit-license.org)
|
113
113
|
}
|
114
|
+
)
|
114
115
|
end
|
115
116
|
end
|
116
117
|
|
117
118
|
it 'should work with a "-" in the remote name' do
|
118
119
|
@badger = Badger.new 'https://github.com/pikesley/diabetes-dashboard.git'
|
119
120
|
@badger.add 'travis'
|
120
|
-
@badger[0].
|
121
|
+
expect(@badger[0]).to eq '[](https://travis-ci.org/pikesley/diabetes-dashboard)'
|
121
122
|
end
|
122
123
|
|
123
124
|
it 'should let me choose a different badge type' do
|
124
125
|
@badger.badge_type 'png'
|
125
126
|
@badger.add 'travis'
|
126
|
-
@badger[0].
|
127
|
+
expect(@badger[0]).to eq '[](https://travis-ci.org/doge/wow)'
|
127
128
|
end
|
128
129
|
end
|
129
|
-
end
|
130
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -10,10 +10,9 @@ Coveralls.wear_merged!
|
|
10
10
|
#
|
11
11
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
12
12
|
RSpec.configure do |config|
|
13
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
14
13
|
config.run_all_when_everything_filtered = true
|
15
14
|
config.filter_run :focus
|
16
|
-
config.fail_fast = true
|
15
|
+
# config.fail_fast = true
|
17
16
|
|
18
17
|
# Run specs in random order to surface order dependencies. If you find an
|
19
18
|
# order dependency and want to debug it, you can fix the order by providing
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: badgerbadgerbadger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pikesley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -72,28 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '3'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rspec-pride
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '2.3'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '2.3'
|
82
|
+
version: '3'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: cucumber
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,6 +217,7 @@ files:
|
|
231
217
|
- features/badger.feature
|
232
218
|
- features/licenses.feature
|
233
219
|
- features/png.feature
|
220
|
+
- features/pulls-and-issues.feature
|
234
221
|
- features/rubygems.feature
|
235
222
|
- features/services.feature
|
236
223
|
- features/ssh-remote.feature
|
@@ -278,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
278
265
|
version: '0'
|
279
266
|
requirements: []
|
280
267
|
rubyforge_project:
|
281
|
-
rubygems_version: 2.
|
268
|
+
rubygems_version: 2.4.3
|
282
269
|
signing_key:
|
283
270
|
specification_version: 4
|
284
271
|
summary: Badge-Driven Development made easy. Generate a set of Github badges for your
|
@@ -287,6 +274,7 @@ test_files:
|
|
287
274
|
- features/badger.feature
|
288
275
|
- features/licenses.feature
|
289
276
|
- features/png.feature
|
277
|
+
- features/pulls-and-issues.feature
|
290
278
|
- features/rubygems.feature
|
291
279
|
- features/services.feature
|
292
280
|
- features/ssh-remote.feature
|