svgshield 0.1.3 → 0.1.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: 98c71f4e4668d935007fd16f61e3fa01bd22e5f8
4
- data.tar.gz: 564d22d63da5aa2e1250139814b04ff48b78bc3a
3
+ metadata.gz: 6348c79c8d12e54c74a8686822bf23f39f02ced3
4
+ data.tar.gz: 3bebf1c6b8441ec6ea463585d0b829536b733074
5
5
  SHA512:
6
- metadata.gz: 5fdd57a767b1a78b7ad742313a9b44ddd5ffdd58c5ac3c3f33ba308143e86ba16a0567e185a142ffb0580676baf83e45a58ba941825f37616dd8046e08009c72
7
- data.tar.gz: af68cde0e251c61e92fd2c49c83a823a4d4e5abe2cb0cb6ef38cb814da24df35e5fdfe2972999936472e94de28bce2e3e2f08eb314f3ecbb477cedacf5957921
6
+ metadata.gz: d50bc2ab35cf95ac233570fbaf134b1359a781fc61fa0801309cdf90ed547b2c01f83913f019e6f87187c53e638b1511ed85c99d0a0e2d4aeeb7407de2731c59
7
+ data.tar.gz: 79cdbb0e401cf6a030f24573e47315b48e2e1af9315767d3bb663f89db1daba142bdf980831e41e1b364e4e19c61d053ef522698103b27b78c403bd4fdf96b74
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ Documentation:
2
+ Enabled: false
3
+
4
+ LineLength:
5
+ Max: 100
6
+
7
+ MethodLength:
8
+ Max: 50
9
+
10
+ ClassLength:
11
+ Max: 150
12
+
13
+ AbcSize:
14
+ Max: 30
data/lib/svgshield.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'rasem'
2
2
  require 'color'
3
- require "svgshield/version"
3
+ require 'svgshield/version'
4
4
 
5
5
  class Svgshield
6
6
  attr_reader :shield
@@ -8,8 +8,8 @@ class Svgshield
8
8
  def initialize(subject, status, color = '#aaa')
9
9
  color = Color::CSS[color] if color[0] == '#'
10
10
 
11
- # subject_width = 37
12
- # status_width = 53
11
+ # subject_width = 37
12
+ # status_width = 53
13
13
  full_width = 86
14
14
  full_height = 20
15
15
 
@@ -26,7 +26,7 @@ class Svgshield
26
26
  group 'clip-path' => 'url(#a)' do
27
27
  path fill: '#555', d: "M0 0h37v#{full_height}H0z"
28
28
  path fill: color, d: "M37 0h49v#{full_height}H37z"
29
- path fill: 'url(#b)' d: "M0 0h#{full_width}v#{full_height}H0z"
29
+ path fill: 'url(#b)', d: "M0 0h#{full_width}v#{full_height}H0z"
30
30
  end
31
31
 
32
32
  group(
@@ -52,7 +52,7 @@ class Svgshield
52
52
  def string_width(string)
53
53
  # Output is (theoretically, anyway) in pixels
54
54
 
55
- string.chars.inject(0) { |sum, char| sum + char_width(char) }.round 0
55
+ string.chars.inject(0) { |a, e| a + char_width(e) }.round 0
56
56
  end
57
57
 
58
58
  def char_width(char)
@@ -1,3 +1,3 @@
1
1
  class Svgshield
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svgshield
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evertrue, Inc
@@ -103,6 +103,7 @@ extra_rdoc_files: []
103
103
  files:
104
104
  - ".gitignore"
105
105
  - ".rspec"
106
+ - ".rubocop.yml"
106
107
  - ".travis.yml"
107
108
  - Gemfile
108
109
  - LICENSE.txt