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 +4 -4
- data/lib/basicons/basicon.rb +15 -1
- data/lib/basicons/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c941b7ca0d5faa006dddca3854205f3844687247a806ca801bf8308cb85a7b12
|
4
|
+
data.tar.gz: 8c69ebfbb8dd9556b544ca388b78ebb25aee0c040ce3a23f2ba12f3cccf48c01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 925df0343ff1489f6d8f089a9a36f8945fb89f34495b9f330f0b0027b422efb695ede57dfc7aa9b4350452dfe40d80528b9d3cae8b6c2c1c07e572a6e4606fdf
|
7
|
+
data.tar.gz: 7e3266dfe853e1f611327c32915babdf09945d0c6e0c9700c41450cf16956b61039e2b60ed1c3de93f5ff7037eacde16518122f8a62c68a28e17f08cc4527f28
|
data/lib/basicons/basicon.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/basicons/version.rb
CHANGED