badgerbadgerbadger 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -8
- data/config/services.yaml +12 -0
- data/lib/badger/badger.rb +1 -7
- data/lib/badger/service.rb +28 -16
- data/lib/badger/version.rb +1 -1
- data/spec/badger_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 509707f111ff5c90e4317418a93f928a28a464b8
|
4
|
+
data.tar.gz: 6963b484b48b76ff0451d4d1cc2fe7b04160597b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a2d485d66c3b92b3629343b9d21ce68971a1b1f46dfc53cef9772c1cf07ed027680871ae6b66f35104b37603b438478cae046b4a88fdf0fdaca75bedc1a0289
|
7
|
+
data.tar.gz: 050765279c4785e697846a9a59e896f290d283853936cb14b6b165fb7b390c6d1f13c37de71e275ccd898fd9ab29973e0d1bce40c6ef2c2c29b3902f5cbdb24f
|
data/README.md
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
[![
|
2
|
-
[![Build Status](https://travis-ci.org/badges/badgerbadgerbadger.svg)](https://travis-ci.org/badges/badgerbadgerbadger)
|
1
|
+
[![Build Status](http://img.shields.io/travis/badges/badgerbadgerbadger.svg)](https://travis-ci.org/badges/badgerbadgerbadger)
|
3
2
|
[![Dependency Status](http://img.shields.io/gemnasium/badges/badgerbadgerbadger.svg)](https://gemnasium.com/badges/badgerbadgerbadger)
|
4
3
|
[![Coverage Status](http://img.shields.io/coveralls/badges/badgerbadgerbadger.svg)](https://coveralls.io/r/badges/badgerbadgerbadger)
|
5
4
|
[![Code Climate](http://img.shields.io/codeclimate/github/badges/badgerbadgerbadger.svg)](https://codeclimate.com/github/badges/badgerbadgerbadger)
|
5
|
+
[![Github Issues](http://githubbadges.herokuapp.com/badges/badgerbadgerbadger/issues.svg)](https://github.com/badges/badgerbadgerbadger/issues)
|
6
|
+
[![Pending Pull-Requests](http://githubbadges.herokuapp.com/badges/badgerbadgerbadger/pulls.svg)](https://github.com/badges/badgerbadgerbadger/pulls)
|
6
7
|
[![Gem Version](http://img.shields.io/gem/v/badgerbadgerbadger.svg)](https://rubygems.org/gems/badgerbadgerbadger)
|
7
8
|
[![License](http://img.shields.io/:license-mit-blue.svg)](http://badges.mit-license.org)
|
8
|
-
[![Badges](http://img.shields.io/:badges-
|
9
|
+
[![Badges](http://img.shields.io/:badges-9/9-ff6799.svg)](https://github.com/badges/badgerbadgerbadger)
|
9
10
|
|
10
11
|
#Badger
|
11
12
|
|
12
|
-
Because I grow weary of copy-n-pasting the badge URLs into the README of every project, and the [img.shields.io](http://img.shields.io) API now supports all of the services I use
|
13
|
+
Because I grow weary of copy-n-pasting the badge URLs into the README of every project, and the [img.shields.io](http://img.shields.io) API now supports all of the services I use
|
13
14
|
|
14
15
|
##Usage
|
15
16
|
|
@@ -21,9 +22,9 @@ or add it to your Gemfile
|
|
21
22
|
|
22
23
|
gem 'badgerbadgerbadger'
|
23
24
|
bundle
|
24
|
-
|
25
|
+
|
25
26
|
Then
|
26
|
-
|
27
|
+
|
27
28
|
badger badge
|
28
29
|
[![Build Status](https://travis-ci.org/doge/wow.svg)](https://travis-ci.org/doge/wow)
|
29
30
|
[![Dependency Status](http://img.shields.io/gemnasium/doge/wow.svg)](https://gemnasium.com/doge/wow)
|
@@ -35,7 +36,7 @@ Then
|
|
35
36
|
|
36
37
|
ready to paste into the top of your README (with the correct URLs for your repo)
|
37
38
|
|
38
|
-
You can read about Badger's Opinions in the help text [here](https://github.com/pikesley/badger/blob/master/DESC.md)
|
39
|
+
You can read about Badger's Opinions in the help text [here](https://github.com/pikesley/badger/blob/master/DESC.md)
|
39
40
|
|
40
41
|
If you're on a Mac, pipe the output into `pbcopy` to add the stuff directly to your clipboard:
|
41
42
|
|
@@ -47,7 +48,7 @@ If you're on a Mac, pipe the output into `pbcopy` to add the stuff directly to y
|
|
47
48
|
cd badger
|
48
49
|
bundle
|
49
50
|
rake
|
50
|
-
|
51
|
+
|
51
52
|
### Adding a new license
|
52
53
|
|
53
54
|
If you'd like badgerbadgerbadger to support a license we don't currently have, please see the note at the top of the [licenses config file](https://github.com/badges/badgerbadgerbadger/blob/master/config/licenses.yaml#L6-L7)
|
data/config/services.yaml
CHANGED
@@ -18,3 +18,15 @@ codeclimate:
|
|
18
18
|
alt_text: Code Climate
|
19
19
|
url_path: codeclimate.com/github
|
20
20
|
badge_slug: codeclimate/github
|
21
|
+
|
22
|
+
pulls:
|
23
|
+
alt_text: Pending Pull-Requests
|
24
|
+
service_root: githubbadges.herokuapp.com
|
25
|
+
url_path: github.com
|
26
|
+
suffix: pulls
|
27
|
+
|
28
|
+
issues:
|
29
|
+
alt_text: Github Issues
|
30
|
+
service_root: githubbadges.herokuapp.com
|
31
|
+
url_path: github.com
|
32
|
+
suffix: issues
|
data/lib/badger/badger.rb
CHANGED
@@ -15,13 +15,7 @@ module Badger
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def add service
|
18
|
-
|
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
|
18
|
+
self << Service.badge(service, github_slug)
|
25
19
|
self.delete nil
|
26
20
|
end
|
27
21
|
|
data/lib/badger/service.rb
CHANGED
@@ -5,29 +5,41 @@ module Badger
|
|
5
5
|
params = Config.instance.services[name]
|
6
6
|
|
7
7
|
scheme = params['scheme'] ||= 'http'
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
]
|
8
|
+
|
9
|
+
if params['service_root']
|
10
|
+
base_url = 'http://%s' % [
|
11
|
+
params['service_root']
|
12
|
+
]
|
13
|
+
else
|
14
|
+
base_url = 'http://%s/%s' % [
|
15
|
+
Config.instance.config['badge_service'],
|
16
|
+
params['badge_slug']
|
17
|
+
]
|
19
18
|
end
|
20
19
|
|
21
20
|
badge_url = '%s/%s' % [
|
22
|
-
|
23
|
-
|
21
|
+
base_url,
|
22
|
+
github_slug
|
24
23
|
]
|
24
|
+
|
25
25
|
target_url = 'https://%s/%s' % [
|
26
|
-
|
27
|
-
|
26
|
+
params['url_path'],
|
27
|
+
github_slug
|
28
28
|
]
|
29
29
|
|
30
|
+
if params['suffix']
|
31
|
+
badge_url = suffixify badge_url, params['suffix']
|
32
|
+
target_url = suffixify target_url, params['suffix']
|
33
|
+
end
|
34
|
+
|
30
35
|
Badger.badge params['alt_text'], badge_url, target_url
|
31
36
|
end
|
37
|
+
|
38
|
+
def self.suffixify path, suffix
|
39
|
+
'%s/%s' % [
|
40
|
+
path,
|
41
|
+
suffix
|
42
|
+
]
|
43
|
+
end
|
32
44
|
end
|
33
|
-
end
|
45
|
+
end
|
data/lib/badger/version.rb
CHANGED
data/spec/badger_spec.rb
CHANGED
@@ -101,6 +101,13 @@ module Badger
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
+
context 'github pulls' do
|
105
|
+
it 'should have a pull-requests badge' do
|
106
|
+
@badger.add 'pulls'
|
107
|
+
expect(@badger[0]).to eq "[![Pending Pull-Requests](http://githubbadges.herokuapp.com/doge/wow/pulls.svg)](https://github.com/doge/wow/pulls)"
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
104
111
|
context 'output' do
|
105
112
|
it 'should produce some lines of text' do
|
106
113
|
@badger.add 'travis'
|
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.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pikesley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|