inch-badge 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81c85a0aa45308466719b944224699b4b6e62326
4
- data.tar.gz: e3409f537dc99bc9e0b1bc1b9b07cb3ab98b4aba
3
+ metadata.gz: fe66ad4fb08661567d0920e026b1200f90b4129d
4
+ data.tar.gz: 7867fa1727f8ed5b12047aa79ec837fe01b8e09e
5
5
  SHA512:
6
- metadata.gz: c94399d410cce68b0d6f762702cfc29d35c735fbdf50fef7a6a24947732c1e6cdb25ba429b797c6f47251c1f9393da630ff96b9ea9891d617118d36ecc6d3923
7
- data.tar.gz: 1c119e4f073b4c4a7124e2b2c6935cda722e4f7f841b35dca60cc9572590fed27a91f4a556bdec604ea7df0ce87d79c2b86080338f2c78764b9f241db4912910
6
+ metadata.gz: 2d3969b1e82957507c5a7119d115a3c213ef5d2dfaa63800783c0c84d0b6dd9f03471ec8271b0f1b078a751c19e18b50efc2912ecb986a90588caf43282c993f
7
+ data.tar.gz: bcc22fcdbb30c8a3885fcf73e59c689cec94b9967b1854a8e2426280087e4d470379f938897dcc81ce7735c1b1de25ab7a8dbac20d1ee67f0b4cc47c162c183b
data/README.md CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  ### Shell
22
22
 
23
- $ inch-badge FILENAME U C B A
23
+ $ inch-badge FILENAME A B C U
24
24
 
25
25
  Example:
26
26
 
@@ -28,6 +28,14 @@ Example:
28
28
 
29
29
  ### Ruby
30
30
 
31
+ Create a PNG badge:
32
+
33
+ ```ruby
34
+ Inch::Badge::Image.create("example.png", [300, 21, 12, 316])
35
+ ```
36
+
37
+ Create a SVG badge:
38
+
31
39
  ```ruby
32
- Inch::Badge::Image.new("example.png", [300, 21, 12, 316]).save
40
+ Inch::Badge::Image.create("example.svg", [300, 21, 12, 316])
33
41
  ```
data/assets/badge.svg.erb CHANGED
@@ -1,16 +1,31 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" width="77" height="18">
2
- <linearGradient id="a" x2="0" y2="100%">
3
- <stop offset="0" stop-color="#fff" stop-opacity=".7"/><stop offset=".1" stop-color="#aaa" stop-opacity=".1"/><stop offset=".9" stop-opacity=".3"/><stop offset="1" stop-opacity=".5"/>
2
+ <linearGradient id="bg" x2="0" y2="100%">
3
+ <stop offset="0" stop-color="#fff" stop-opacity=".7"/>
4
+ <stop offset=".1" stop-color="#aaa" stop-opacity=".1"/>
5
+ <stop offset=".9" stop-opacity=".3"/>
6
+ <stop offset="1" stop-opacity=".5"/>
4
7
  </linearGradient>
5
8
  <rect rx="4" width="77" height="18" fill="#555"/>
6
9
 
7
10
  <% x = 0 %>
8
11
  <% @grades.each do |grade| %>
9
- <rect x="<%= 34+x %>" y="4" width="<%= grade.width %>" height="10" fill="<%= grade.color %>"/>
12
+ <linearGradient id="g<%= grade.name %>" x2="0" y2="100%">
13
+ <stop offset="0" stop-color="#999" stop-opacity=".3"/>
14
+ <stop offset=".1" stop-color="<%= grade.color %>" stop-opacity=".9"/>
15
+ <stop offset=".5" stop-color="<%= grade.color %>" stop-opacity="1"/>
16
+ <stop offset=".9" stop-color="<%= grade.color %>" stop-opacity=".9"/>
17
+ <stop offset="1" stop-color="#888" stop-opacity=".3"/>
18
+ </linearGradient>
19
+ <rect x="<%= 34+x %>" y="4" width="<%= grade.width %>" height="10" fill="url(#g<%= grade.name %>)"/>
10
20
  <% x += grade.width %>
11
21
  <% end %>
12
22
 
13
- <rect rx="4" width="77" height="18" fill="url(#a)"/>
23
+ <rect x="34" y="4" width="1" height="1" fill="#666"/>
24
+ <rect x="34" y="13" width="1" height="1" fill="#666"/>
25
+ <rect x="73" y="4" width="1" height="1" fill="#666"/>
26
+ <rect x="73" y="13" width="1" height="1" fill="#666"/>
27
+
28
+ <rect rx="4" width="77" height="18" fill="url(#bg)"/>
14
29
  <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
15
30
  <text x="18.5" y="13" fill="#010101" fill-opacity=".3">docs</text>
16
31
  <text x="18.5" y="12">docs</text>
@@ -2,7 +2,7 @@ module Inch
2
2
  module Badge
3
3
  class Config
4
4
  GRADE_ORDER = %w(A B C U)
5
- GRADE_COLOR = %w(#46b01e #87ae10 #c05946 #8f7eb4)
5
+ GRADE_COLOR = %w(#46cc1e #87ae10 #c05946 #8f7eb4)
6
6
  SECTION_WIDTH = 40 # px
7
7
 
8
8
  class << self
@@ -1,5 +1,5 @@
1
1
  module Inch
2
2
  module Badge
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inch-badge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - René Föhring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-11 00:00:00.000000000 Z
11
+ date: 2014-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chunky_png
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.2.0
114
+ rubygems_version: 2.2.2
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Rubygem used to generate badges for Inch