badgerbadgerbadger 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71146b486d477909b9c46a8dd9b3f5e27f49095e
4
- data.tar.gz: e1d60721ac659456aa3413f45079fd824abc858e
3
+ metadata.gz: 8d98b568c5a24105cbe6fec59d1e1ab3e916a7da
4
+ data.tar.gz: 9256aaeef8bc403f6248aa7a79967cf70cb55c9c
5
5
  SHA512:
6
- metadata.gz: a161ba164c17abc862d3c7635dec0ad9080731fee9d204f554991ed5bc9056b2a20c0bba5bcc38eae8047dcad6fa0f11dd475d367ba370b111661b36c98563e1
7
- data.tar.gz: 59790aef4466a6217b95a6bf428656c8606e6a9ca938b5aa4e92358c7bb086c21a3e458afda36bc11a12637177da3bceaefe80f630a0b79f61501a0edc04a379
6
+ metadata.gz: 75388f2ffd48248c7bf5db7f99cccdba3e30ccaaa48955811d491b4f90e914865b67bbc1bd0da6342b1a81020d5a64db56c4ce0630ea76ec8838b4ec0f1b3675
7
+ data.tar.gz: 4ef2985c9a6cddc2b53ccd94fdd1d8c751ac20537582283339876251d31212cd905b5c66c972e23d9bae84e6210c25e66679e1bdf6a6d650e597c90b94b377ba
data/DESC.md ADDED
@@ -0,0 +1,27 @@
1
+ Highly-opinionated badge generator for Github READMEs:
2
+
3
+ * If it finds a .travis.yml, it generates a Travis-CI Build-Status Badge
4
+
5
+ * If it finds a Gemfile or a gemspec, it generates a Gemnasium Dependency Status Badge
6
+
7
+ * If it finds 'coveralls' in a Gemfile or gemspec, it generates a Coveralls Coverage Status Badge
8
+
9
+ * If it's generated at least one of the above, it generates a Code Climate Status Badge
10
+
11
+ In addition, if it finds a gemspec, it will use it to generate:
12
+
13
+ * A Rubygems Version Badge
14
+
15
+ * A License Badge
16
+
17
+ And if a license file is found, a License Badge will be generated. Currently supported licenses are:
18
+
19
+ * MIT
20
+
21
+ * Apache
22
+
23
+ * GPL-2
24
+
25
+ * GPL-3
26
+
27
+ The supported license details are in `https://github.com/pikesley/badger/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.
data/README.md CHANGED
@@ -34,11 +34,7 @@ Then
34
34
 
35
35
  ready to paste into the top of your README (with the correct URLs for your repo)
36
36
 
37
- Try
38
-
39
- badger help badge
40
-
41
- to read about Badger's Opinions
37
+ You can read about Badger's Opinions [here](DESC.md)
42
38
 
43
39
  If you're on a Mac, pipe the output into `pbcopy` to add the stuff directly to your clipboard:
44
40
 
@@ -1,19 +1,19 @@
1
1
  travis:
2
2
  alt_text: Build Status
3
- url: travis-ci.org
3
+ url_path: travis-ci.org
4
4
  badge_slug: travis
5
5
 
6
6
  coveralls:
7
7
  alt_text: Coverage Status
8
- url: coveralls.io/r
8
+ url_path: coveralls.io/r
9
9
  badge_slug: coveralls
10
10
 
11
11
  gemnasium:
12
12
  alt_text: Dependency Status
13
- url: gemnasium.com
13
+ url_path: gemnasium.com
14
14
  badge_slug: gemnasium
15
15
 
16
16
  codeclimate:
17
17
  alt_text: Code Climate
18
- url: codeclimate.com/github
18
+ url_path: codeclimate.com/github
19
19
  badge_slug: codeclimate/github
@@ -2,10 +2,10 @@ require 'aruba/cucumber'
2
2
  require 'cucumber/rspec/doubles'
3
3
  require 'git'
4
4
  require 'fileutils'
5
-
6
5
  require 'coveralls'
7
- Coveralls.wear_merged!
8
6
 
9
7
  require 'badger/badger'
10
8
 
11
- $temp_repo = '/tmp/wow_repo'
9
+ $temp_repo = '/tmp/wow_repo'
10
+
11
+ Coveralls.wear_merged!
@@ -1,5 +1,7 @@
1
1
  require 'git'
2
2
  require 'thor'
3
+ require 'yaml'
4
+ require 'singleton'
3
5
 
4
6
  require 'badger/version'
5
7
  require 'badger/config'
@@ -7,7 +7,9 @@ module Badger
7
7
  badger.length + 1,
8
8
  Config.instance.config['bonus_badge_colour']
9
9
  ]
10
- target_url = '%s' % Config.instance.config['bonus_badge_link']
10
+ target_url = '%s' % [
11
+ Config.instance.config['bonus_badge_link']
12
+ ]
11
13
 
12
14
  Badger.badge 'Badges', badge_url, target_url
13
15
  end
@@ -4,36 +4,7 @@ module Badger
4
4
  class CLI < Thor
5
5
 
6
6
  desc 'badge', 'Generate badge markdown'
7
- long_desc <<-LONGDESC
8
- Highly-opinionated badge generator for Github READMEs:
9
-
10
- * If it finds a .travis.yml, it generates a Travis-CI Build-Status Badge
11
-
12
- * If it finds a Gemfile or a gemspec, it generates a Gemnasium Dependency Status Badge
13
-
14
- * If it finds 'coveralls' in a Gemfile or gemspec, it generates a Coveralls Coverage Status Badge
15
-
16
- * If it's generated at least one of the above, it generates a Code Climate Status Badge
17
-
18
- In addition, if it finds a gemspec, it will use it to generate:
19
-
20
- * A Rubygems Version Badge
21
-
22
- * A License Badge
23
-
24
- And if a license file is found, a License Badge will be generated. Currently supported licenses are:
25
-
26
- * MIT
27
-
28
- * Apache
29
-
30
- * GPL-2
31
-
32
- * GPL-3
33
-
34
- The supported license details are in https://github.com/pikesley/badger/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.
35
-
36
- LONGDESC
7
+ long_desc File.read File.join File.dirname( __FILE__), '..', '..', 'DESC.md'
37
8
 
38
9
  def badge dir = '.'
39
10
  @badger = Badger.new Badger.git_remote dir
@@ -1,15 +1,12 @@
1
- require 'yaml'
2
- require 'singleton'
3
-
4
1
  module Badger
5
2
  class Config
6
3
 
7
4
  include Singleton
8
5
 
9
6
  def initialize
10
- @config = YAML.load(File.open(File.join(File.dirname(__FILE__), '..', '..', 'config/config.yaml')))
11
- @services = YAML.load(File.open(File.join(File.dirname(__FILE__), '..', '..', 'config/services.yaml')))
12
- @licenses = YAML.load(File.open(File.join(File.dirname(__FILE__), '..', '..', 'config/licenses.yaml')))
7
+ @config = fetch_yaml 'config'
8
+ @services = fetch_yaml 'services'
9
+ @licenses = fetch_yaml 'licenses'
13
10
  end
14
11
 
15
12
  def services
@@ -23,5 +20,22 @@ module Badger
23
20
  def config
24
21
  @config
25
22
  end
23
+
24
+ private
25
+
26
+ def fetch_yaml file
27
+ YAML.load(
28
+ File.open(
29
+ File.join(
30
+ File.dirname(__FILE__),
31
+ '..',
32
+ '..',
33
+ 'config/%s.yaml' % [
34
+ file
35
+ ]
36
+ )
37
+ )
38
+ )
39
+ end
26
40
  end
27
41
  end
@@ -1,5 +1,4 @@
1
1
  module Badger
2
-
3
2
  def Badger.is_repo? dir
4
3
  begin
5
4
  Git.open(dir)
@@ -10,7 +10,7 @@ module Badger
10
10
  github_slug
11
11
  ]
12
12
  target_url = 'https://%s/%s' % [
13
- params['url'],
13
+ params['url_path'],
14
14
  github_slug
15
15
  ]
16
16
 
@@ -1,3 +1,3 @@
1
1
  module Badger
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.4"
3
3
  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.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - pikesley
@@ -217,6 +217,7 @@ files:
217
217
  - ".gitignore"
218
218
  - ".rspec"
219
219
  - ".travis.yml"
220
+ - DESC.md
220
221
  - Gemfile
221
222
  - Guardfile
222
223
  - LICENSE.md