svgshield 0.1.1 → 0.1.2

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: a8229b1a58cb16fc4690270dc5cecd33d8ef01cd
4
- data.tar.gz: c60e4c0f4f8bec834b8e5df342a5aae1dbffc50d
3
+ metadata.gz: 8f15084c4017e592e7475989d0eac4cf6c7411f7
4
+ data.tar.gz: 60bb1f8dc3184cf1eb669b6a811ed00b3768c547
5
5
  SHA512:
6
- metadata.gz: 0412b769bb23ebfca33bd0d16127f4a2b4d7f270457ffc9569997f9d24584a071f9f1423d5d7af3fabc875bae9fce8b65f4b13730a86061239bdbc806a3dead2
7
- data.tar.gz: f4fee0af29d06e5772314bc21d9601500876856100dff68cacd154a713f392ea1ca5b7e20742d8ab01039884a61332fb15a3fd660a8f76698861ba874eddfe2b
6
+ metadata.gz: 94a4786f17d7100380fdbf9946c8e4a773a419ae2613eac8890dae35708595cc22c8b09cbe28e59f8e7e23dd5292d9022b50901b08bfeded74c141d4bcf7ff96
7
+ data.tar.gz: 43b864f38614f6366cd8f38a744a307f3256344bb22441a761bc16196ba22760f8d2588ffc38284cfc549825116a7f3cfa565eb56ff52374c30cd846fc2bbba1
data/README.md CHANGED
@@ -21,8 +21,8 @@ And then execute:
21
21
  To generate an image object:
22
22
 
23
23
  ```ruby
24
- redimage1 = Svgshield.new('Subject', 'Status', 'red') # color words
25
- redimage2 = Svgshield.new('Subject', 'Status', '#f00') # hexadecimal colors
24
+ redimage1 = Svgshield.new('Subject', 'Status', 'red').to_s # color words
25
+ redimage2 = Svgshield.new('Subject', 'Status', '#f00').to_s # hexadecimal colors
26
26
  ```
27
27
 
28
28
  ## Development
@@ -1,3 +1,3 @@
1
1
  class Svgshield
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/svgshield.rb CHANGED
@@ -1,11 +1,14 @@
1
1
  require 'rasem'
2
+ require 'color'
2
3
  require "svgshield/version"
3
4
 
4
5
  class Svgshield
6
+ attr_reader :shield
7
+
5
8
  def initialize(subject, status, color = '#aaa')
6
9
  color = Color::CSS[color] if color[0] == '#'
7
10
 
8
- Rasem::SVGImage.new(width: 90, height: 20) do
11
+ @shield = Rasem::SVGImage.new(width: 90, height: 20) do
9
12
  linearGradient('a', x2: 0, y2: '100%') do
10
13
  stop 0, '#bbb', '.1'
11
14
  stop 1, nil, '.1'
@@ -29,4 +32,8 @@ class Svgshield
29
32
  end
30
33
  end
31
34
  end
35
+
36
+ def to_s
37
+ shield.to_s
38
+ end
32
39
  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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evertrue, Inc