badgerbadgerbadger 0.7.5 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/config.yaml +2 -1
- data/features/png.feature +18 -0
- data/lib/badger/badge.rb +2 -1
- data/lib/badger/badger.rb +4 -0
- data/lib/badger/bonus.rb +1 -1
- data/lib/badger/cli.rb +3 -0
- data/lib/badger/config.rb +4 -0
- data/lib/badger/license.rb +1 -1
- data/lib/badger/rubygem.rb +1 -1
- data/lib/badger/service.rb +1 -1
- data/lib/badger/version.rb +1 -1
- data/spec/badger_spec.rb +7 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ae58ef80b784589eb8a771600e24964f2b7a175
|
4
|
+
data.tar.gz: 6dcc7fa5013a11f2b225db292aa084ba49b26e57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfea32ab36bebf314ccfee0807577dc7f182d5475f5d6aed023f7928f335533a8b64e356e5b776f9d04b16bb2f14f96c527c909444bbbdb3378669a021c23a68
|
7
|
+
data.tar.gz: d799173f26852c63c1b3fc98711b55c1e6a286c7dd6e6a11641bd6ac98d04f29b6dcab353b51dd37a0b88593c52dd6610e48e647ed2188c715b5f8cec18fcc61
|
data/config/config.yaml
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
Feature: Badge robot
|
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 /tmp/wow_repo --png `
|
9
|
+
Then the output should contain:
|
10
|
+
"""
|
11
|
+
[![Build Status](http://img.shields.io/travis/doge/wow.png)](https://travis-ci.org/doge/wow)
|
12
|
+
[![Dependency Status](http://img.shields.io/gemnasium/doge/wow.png)](https://gemnasium.com/doge/wow)
|
13
|
+
[![Coverage Status](http://img.shields.io/coveralls/doge/wow.png)](https://coveralls.io/r/doge/wow)
|
14
|
+
[![Code Climate](http://img.shields.io/codeclimate/github/doge/wow.png)](https://codeclimate.com/github/doge/wow)
|
15
|
+
[![Gem Version](http://img.shields.io/gem/v/suchgem.png)](https://rubygems.org/gems/suchgem)
|
16
|
+
[![License](http://img.shields.io/:license-mit-blue.png)](http://doge.mit-license.org)
|
17
|
+
[![Badges](http://img.shields.io/:badges-7/7-ff6799.png)](https://github.com/pikesley/badger)
|
18
|
+
"""
|
data/lib/badger/badge.rb
CHANGED
data/lib/badger/badger.rb
CHANGED
data/lib/badger/bonus.rb
CHANGED
data/lib/badger/cli.rb
CHANGED
@@ -5,10 +5,13 @@ module Badger
|
|
5
5
|
|
6
6
|
desc 'badge', 'Generate badge markdown'
|
7
7
|
long_desc File.read File.join File.dirname( __FILE__), '..', '..', 'DESC.md'
|
8
|
+
method_option :png, :type => :boolean, :default => false, :desc => 'Generate PNG badges instead of the default SVG'
|
8
9
|
|
9
10
|
def badge dir = '.'
|
10
11
|
@badger = Badger.new Badger.git_remote dir
|
11
12
|
|
13
|
+
@badger.badge_type 'png' if options[:png]
|
14
|
+
|
12
15
|
@badger.add 'travis' if Badger.has_travis? dir
|
13
16
|
@badger.add 'gemnasium' if Badger.has_gemfile? dir
|
14
17
|
@badger.add 'coveralls' if Badger.has_coveralls? dir
|
data/lib/badger/config.rb
CHANGED
data/lib/badger/license.rb
CHANGED
@@ -10,7 +10,7 @@ module Badger
|
|
10
10
|
end
|
11
11
|
|
12
12
|
badge_text = type unless badge_text = params['badge_text']
|
13
|
-
badge_url = 'http://%s/:license-%s-%s
|
13
|
+
badge_url = 'http://%s/:license-%s-%s' % [
|
14
14
|
Config.instance.config['badge_service'],
|
15
15
|
badge_text,
|
16
16
|
Config.instance.config['license_colour']
|
data/lib/badger/rubygem.rb
CHANGED
data/lib/badger/service.rb
CHANGED
@@ -4,7 +4,7 @@ module Badger
|
|
4
4
|
return nil unless params = Config.instance.services[name]
|
5
5
|
params = Config.instance.services[name]
|
6
6
|
|
7
|
-
badge_url = 'http://%s/%s/%s
|
7
|
+
badge_url = 'http://%s/%s/%s' % [
|
8
8
|
Config.instance.config['badge_service'],
|
9
9
|
params['badge_slug'],
|
10
10
|
github_slug
|
data/lib/badger/version.rb
CHANGED
data/spec/badger_spec.rb
CHANGED
@@ -3,6 +3,7 @@ require 'spec_helper'
|
|
3
3
|
module Badger
|
4
4
|
describe Badger do
|
5
5
|
before :each do
|
6
|
+
Config.instance.config['badge_type'] = 'svg'
|
6
7
|
@badger = Badger.new "https://github.com/doge/wow"
|
7
8
|
end
|
8
9
|
|
@@ -115,5 +116,11 @@ module Badger
|
|
115
116
|
@badger.add 'travis'
|
116
117
|
@badger[0].should == '[![Build Status](http://img.shields.io/travis/pikesley/diabetes-dashboard.svg)](https://travis-ci.org/pikesley/diabetes-dashboard)'
|
117
118
|
end
|
119
|
+
|
120
|
+
it 'should let me choose a different badge type' do
|
121
|
+
@badger.badge_type 'png'
|
122
|
+
@badger.add 'travis'
|
123
|
+
@badger[0].should == '[![Build Status](http://img.shields.io/travis/doge/wow.png)](https://travis-ci.org/doge/wow)'
|
124
|
+
end
|
118
125
|
end
|
119
126
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: badgerbadgerbadger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pikesley
|
@@ -230,6 +230,7 @@ files:
|
|
230
230
|
- config/services.yaml
|
231
231
|
- features/badger.feature
|
232
232
|
- features/licenses.feature
|
233
|
+
- features/png.feature
|
233
234
|
- features/rubygems.feature
|
234
235
|
- features/services.feature
|
235
236
|
- features/ssh-remote.feature
|
@@ -280,6 +281,7 @@ summary: Badge-Driven Development made easy. Generate a set of Github badges for
|
|
280
281
|
test_files:
|
281
282
|
- features/badger.feature
|
282
283
|
- features/licenses.feature
|
284
|
+
- features/png.feature
|
283
285
|
- features/rubygems.feature
|
284
286
|
- features/services.feature
|
285
287
|
- features/ssh-remote.feature
|