repo-small-badge 0.2.3 → 0.2.5

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
  SHA256:
3
- metadata.gz: 8d5f7992964dd9cad861f7a69f7570b743362c4edce645a770f54fc16cb5e7ca
4
- data.tar.gz: 67351cf68c32503cb1e73cd15b995b2aecc188b940e435bec4878f8076aeb59c
3
+ metadata.gz: 101a337bf142f46cd532938677eb6a28f4ae652431f276ecc3dcc99da3568b94
4
+ data.tar.gz: 77891f4ddd8c08b271e11f6fb0f41d54ae2b7bc35ac6f1ef6b9b16a3a103bfaa
5
5
  SHA512:
6
- metadata.gz: 4f2f91a28b8f2de41c4c2f7ba3d48195e73cdba2520faec4ea2e53667f7f0b33a5a3950b94ab6a41fcf2016c38bfd0ba04ea469084f0b4b5376e5aa74bd99c5e
7
- data.tar.gz: 99254c8a452c4d4997c2ce4f55606cddb1038967e029d03a5a07061b43c88b493ec72a01f44210c9de7fea138d41d2f8ae5a00c19b8a4490675744711e071ffa
6
+ metadata.gz: 660548f9e30b65e4162d4e752e566f352aeb7b752cd64ce7423e660dc8506dd067fce99d87525b52e66137fa0d710d73cf6e715778022642a0e8c4306479bd43
7
+ data.tar.gz: b568d8437cc34ee2f47fcb8ea4e4b44c8ea31c9137eac7f8599702457650b7cf904792f7363ed76bcf30742a00d47a4bfc0a53ed84ca5d1585ed5cb77626323f
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  Gemfile.lock
4
4
 
5
5
  ## PROJECT::GENERAL
6
- coverage
7
6
  rdoc
8
7
  pkg
9
8
  .sass-cache
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.1
1
+ 2.5.3
data/.travis.yml CHANGED
@@ -3,13 +3,14 @@ branches:
3
3
  only:
4
4
  - master
5
5
  rvm:
6
- - 2.5.1
6
+ - 2.5.3
7
7
  cache: bundler
8
8
  bundler_args: "--jobs=3 --retry=3 --without production"
9
9
  matrix:
10
10
  fast_finish: true
11
11
  script:
12
12
  - sh script/travis.sh
13
+
13
14
  deploy:
14
15
  provider: pages
15
16
  skip-cleanup: true
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Change Logs
2
2
 
3
- # Version 0.2.2
3
+ # 0.2.4
4
+
5
+ * Fix format SVG to look better
6
+ * Support rubycritic badge (perliminary)
7
+
8
+ # 0.2.3
9
+
10
+ * More flexibility for configuring the different font colors and sizes.
11
+
12
+ # 0.2.2
4
13
 
5
14
  * Fix documentation to refer to victor instead of Minimagic
6
15
  * Fix travis build to produce a bagde
data/Gemfile CHANGED
@@ -5,3 +5,7 @@ source 'https://rubygems.org'
5
5
  gemspec
6
6
 
7
7
  gem 'byebug', group: %i[development test]
8
+ gem 'rubycritic', git: 'https://github.com/marcgrimme/rubycritic',
9
+ branch: 'feature/support-dynamic-reports'
10
+ gem 'rubycritic-small-badge',
11
+ git: 'https://github.com/marcgrimme/rubycritic-small-badge'
data/README.md CHANGED
@@ -3,7 +3,8 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/repo-small-badge.svg)](https://badge.fury.io/rb/repo-small-badge)
4
4
  [![Build Status](https://api.travis-ci.org/MarcGrimme/repo-small-badge.svg?branch=master)](https://secure.travis-ci.org/MarcGrimme/repo-small-badge)
5
5
  [![Depfu](https://badges.depfu.com/badges/e794da00404482f66ce7ca05eea9640b/count.svg)](https://depfu.com/github/MarcGrimme/repo-small-badge?project_id=6915)
6
- ![Coverage](https://marcgrimme.github.io/repo-small-badge/badges/coverage_badge_total.svg)
6
+ [![Coverage](https://marcgrimme.github.io/repo-small-badge/badges/coverage_badge_total.svg)](https://marcgrimme.github.io/repo-small-badge/coverage/index.html)
7
+ [![RubyCritic](https://marcgrimme.github.io/repo-small-badge/badges/rubycritic_badge_score.svg)](https://marcgrimme.github.io/repo-small-badge/tmp/rubycritic/overview.html)
7
8
 
8
9
  *RepoSmalladge* is a gem that can be added to the `Gemfile` and consolidates functionality to produce a badge file.
9
10
  The text place and other configurable can be specified at instance time.
data/Rakefile CHANGED
@@ -6,5 +6,17 @@ Bundler::GemHelper.install_tasks
6
6
  require 'rspec/core/rake_task'
7
7
  RSpec::Core::RakeTask.new('spec')
8
8
 
9
+ require 'rubycritic_small_badge'
10
+ require 'rubycritic/rake_task'
11
+ RubyCriticSmallBadge.configure do |config|
12
+ config.minimum_score = ENV.fetch('RUBYCRITICLIMIT', 90.0)
13
+ end
14
+ RubyCritic::RakeTask.new do |task|
15
+ task.options = %(--formatter RubyCriticSmallBadge::Report
16
+ --minimum-score #{RubyCriticSmallBadge.config.minimum_score}
17
+ --format html --format console)
18
+ task.paths = FileList['lib/**/*.rb']
19
+ end
20
+
9
21
  # If you want to make this the default task
10
22
  task default: :spec
@@ -16,7 +16,7 @@ module RepoSmallBadge
16
16
  contentStyleType: 'text/css', preserveAspectRatio: 'xMidYMid meet',
17
17
  'xmlns:xlink': 'http://www.w3.org/1999/xlink',
18
18
  xmlns: 'http://www.w3.org/2000/svg', version: '1.0',
19
- height: @config.badge_height)
19
+ height: @config.badge_height, width: @config.badge_width)
20
20
  end
21
21
 
22
22
  # Creates the badge.
@@ -41,7 +41,7 @@ module RepoSmallBadge
41
41
  private
42
42
 
43
43
  def svg_header
44
- element :linearGradient, id: 'smooth', x2: '0', y2: '100%' do
44
+ element :linearGradient, id: 'smooth', x2: '0', y2: @config.badge_width do
45
45
  element :stop, offset: '0', 'stop-color': '#bbb', 'stop-opacity': '.1'
46
46
  element :stop, offset: '1', 'stop-opacity': '.1'
47
47
  end
@@ -74,7 +74,7 @@ module RepoSmallBadge
74
74
  def svg_title(title)
75
75
  element :g, fill: @config.title_color, 'text-anchor': 'middle',
76
76
  'font-family': @config.title_font,
77
- size: @config.title_font_size do |_svg|
77
+ 'font-size': @config.title_font_size do |_svg|
78
78
  element :text, @config.title(title),
79
79
  x: @config.badge_middle / 2, y: @config.badge_height - 5,
80
80
  fill: '#010101', 'fill-opacity': '0.3'
@@ -87,7 +87,7 @@ module RepoSmallBadge
87
87
  def svg_value(value)
88
88
  element :g, fill: @config.value_color, 'text-anchor': 'middle',
89
89
  'font-family': @config.value_font,
90
- size: @config.value_font_size do |_svg|
90
+ 'font-size': @config.value_font_size do |_svg|
91
91
  element :text, value,
92
92
  x: @config.badge_middle / 2 + @config.badge_middle,
93
93
  y: @config.badge_height - 5,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RepoSmallBadge
4
- VERSION = '0.2.3'
4
+ VERSION = '0.2.5'
5
5
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.add_dependency 'victor', '~> 0.2' # to create the svg
20
20
  s.add_development_dependency 'rake', '~> 12'
21
21
  s.add_development_dependency 'rspec', '~> 3.8'
22
- s.add_development_dependency 'rubocop', '~> 0.63'
22
+ s.add_development_dependency 'rubocop', '~> 0.65'
23
23
  s.add_development_dependency 'simplecov', '~> 0.16'
24
24
  s.add_development_dependency 'simplecov-small-badge', '~> 0.1'
25
25
 
data/script/travis.sh CHANGED
@@ -7,8 +7,11 @@ bundle exec rspec
7
7
  bundle exec rubocop
8
8
  if [ -z "$QUICK" ]; then
9
9
  gem install bundler-audit && bundle-audit update && bundle-audit check
10
- gem install rubycritic && rubycritic app lib config ${RUBYCRITICPARAMS} --format console --minimum-score ${RUBYCRITICLIMIT}
11
- echo "Pushing badges upstream"
12
- [ -d badges ] || mkdir badges
13
- cp coverage/coverage_badge* badges/ 2>/dev/null || true
10
+ bundle exec rake rubycritic lib ${RUBYCRITICPARAMS}
11
+ # only move to the gh-pages if not a PR or branch is master
12
+ if [ "$TRAVIS_PULL_REQUEST" = "false" ] || [ "$TRAVIS_BRANCH" = "master" ]; then
13
+ echo "Pushing badges upstream"
14
+ [ -d badges ] || mkdir badges
15
+ cp coverage/coverage_badge* badges/ 2>/dev/null || true
16
+ fi
14
17
  fi
@@ -4,9 +4,9 @@ module TestRepoSmallBadge
4
4
  # rubocop:disable Metrics/MethodLength,Metrics/LineLength,Metrics/ParameterLists
5
5
  def rounded_svg_string(title_color: '#fff', title_font: 'Verdana,sans-serif', title_font_size: 11,
6
6
  value_color: '#fff', value_font: 'Verdana,sans-serif', value_font_size: 11)
7
- %(<svg contentScriptType="text/ecmascript" contentStyleType="text/css" preserveAspectRatio="xMidYMid meet" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.0" height="20" width="100%">
7
+ %(<svg contentScriptType="text/ecmascript" contentStyleType="text/css" preserveAspectRatio="xMidYMid meet" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.0" height="20" width="120">
8
8
 
9
- <linearGradient id="smooth" x2="0" y2="100%">
9
+ <linearGradient id="smooth" x2="0" y2="120">
10
10
  <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
11
11
  <stop offset="1" stop-opacity=".1"/>
12
12
  </linearGradient>
@@ -18,7 +18,7 @@ module TestRepoSmallBadge
18
18
  <rect x="60" height="20" width="60" fill="#4c1"/>
19
19
  <rect height="20" width="120" fill="url(#smooth)"/>
20
20
  </g>
21
- <g fill="#{title_color}" text-anchor="middle" font-family="#{title_font}" size="#{title_font_size}">
21
+ <g fill="#{title_color}" text-anchor="middle" font-family="#{title_font}" font-size="#{title_font_size}">
22
22
  <text x="30" y="15" fill="#010101" fill-opacity="0.3">
23
23
  Total
24
24
  </text>
@@ -26,7 +26,7 @@ Total
26
26
  Total
27
27
  </text>
28
28
  </g>
29
- <g fill="#{value_color}" text-anchor="middle" font-family="#{value_font}" size="#{value_font_size}">
29
+ <g fill="#{value_color}" text-anchor="middle" font-family="#{value_font}" font-size="#{value_font_size}">
30
30
  <text x="90" y="15" fill="#010101" fill-opacity="0.3">
31
31
  100%
32
32
  </text>
@@ -38,9 +38,9 @@ Total
38
38
  end
39
39
 
40
40
  def not_rounded_svg_string
41
- %(<svg contentScriptType="text/ecmascript" contentStyleType="text/css" preserveAspectRatio="xMidYMid meet" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.0" height="20" width="100%">
41
+ %(<svg contentScriptType="text/ecmascript" contentStyleType="text/css" preserveAspectRatio="xMidYMid meet" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.0" height="20" width="200">
42
42
 
43
- <linearGradient id="smooth" x2="0" y2="100%">
43
+ <linearGradient id="smooth" x2="0" y2="200">
44
44
  <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
45
45
  <stop offset="1" stop-opacity=".1"/>
46
46
  </linearGradient>
@@ -52,7 +52,7 @@ Total
52
52
  <rect x="100" height="20" width="100" fill="#4c1"/>
53
53
  <rect height="20" width="200" fill="url(#smooth)"/>
54
54
  </g>
55
- <g fill="#fff" text-anchor="middle" font-family="Verdana,sans-serif" size="11">
55
+ <g fill="#fff" text-anchor="middle" font-family="Verdana,sans-serif" font-size="11">
56
56
  <text x="50" y="15" fill="#010101" fill-opacity="0.3">
57
57
  badge Total
58
58
  </text>
@@ -60,7 +60,7 @@ badge Total
60
60
  badge Total
61
61
  </text>
62
62
  </g>
63
- <g fill="#fff" text-anchor="middle" font-family="Verdana,sans-serif" size="11">
63
+ <g fill="#fff" text-anchor="middle" font-family="Verdana,sans-serif" font-size="11">
64
64
  <text x="150" y="15" fill="#010101" fill-opacity="0.3">
65
65
  100%
66
66
  </text>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repo-small-badge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Grimme
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.63'
61
+ version: '0.65'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.63'
68
+ version: '0.65'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  requirements: []
147
147
  rubyforge_project: repo-small-badge
148
- rubygems_version: 2.7.7
148
+ rubygems_version: 2.7.8
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: Small Badge generator to be used for different tools 4 ruby