basicons 1.0.5 → 1.0.6

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: baa97944d5712d165ad635be5d6e5a55db7112b1ee8fb79817080e39a610eb70
4
- data.tar.gz: 3a868ffaaef7f858b53b3d958022e62f9bdd5f5c0a59d6187e326ca7b1a2fa39
3
+ metadata.gz: c941b7ca0d5faa006dddca3854205f3844687247a806ca801bf8308cb85a7b12
4
+ data.tar.gz: 8c69ebfbb8dd9556b544ca388b78ebb25aee0c040ce3a23f2ba12f3cccf48c01
5
5
  SHA512:
6
- metadata.gz: 634b1f736797e8a2c130f70c4ea96bcd3e2385457750c2a97dbd2a556b8a5e61f4f9d042f6ae3ada90ddeaebdc32824be2d0c2802d0a6199d5db4684159770e4
7
- data.tar.gz: a8b7b75466231f3257cb0ff842d5d388dd92edba6fd6a67ba974ddab51d833bc8b69886380192a076ac1885a10851df2a2801277eb7ab748637b0d6066981995
6
+ metadata.gz: 925df0343ff1489f6d8f089a9a36f8945fb89f34495b9f330f0b0027b422efb695ede57dfc7aa9b4350452dfe40d80528b9d3cae8b6c2c1c07e572a6e4606fdf
7
+ data.tar.gz: 7e3266dfe853e1f611327c32915babdf09945d0c6e0c9700c41450cf16956b61039e2b60ed1c3de93f5ff7037eacde16518122f8a62c68a28e17f08cc4527f28
@@ -1,5 +1,11 @@
1
1
  module Basicons
2
2
  class Basicon
3
+ SVG_SIZES = {
4
+ small: 16,
5
+ medium: 32,
6
+ large: 64
7
+ }.freeze
8
+
3
9
  attr_reader :data, :size
4
10
  attr_reader :symbol, :options
5
11
 
@@ -17,6 +23,7 @@ module Basicons
17
23
  fill: 'none'
18
24
  })
19
25
 
26
+ @options.delete(:size)
20
27
  @options['stroke-width'] = 2
21
28
  @options['stroke-linecap'] = 'round'
22
29
  @options['stroke-linejoin'] = 'round'
@@ -39,8 +46,15 @@ module Basicons
39
46
 
40
47
  def svg_size
41
48
  return @size unless @size.nil?
49
+
42
50
  @size = @options[:size].to_i
43
- @size = 16 if @size.zero?
51
+ value = @options[:size].to_s
52
+
53
+ if value.match?(/small|medium|large/)
54
+ @size = SVG_SIZES[value.to_sym]
55
+ end
56
+
57
+ @size = 24 if @size.zero?
44
58
  @size
45
59
  end
46
60
 
@@ -1,3 +1,3 @@
1
1
  module Basicons
2
- VERSION = '1.0.5'.freeze
2
+ VERSION = '1.0.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basicons
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Basicons Team