basicons 1.0.4 → 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/assets/data.json +1 -1
- 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/assets/data.json
CHANGED
@@ -319,4 +319,4 @@
|
|
319
319
|
"media-film-video-alt": "<path d=\"M2 17H22M2 7H22M7 2V7M7 17V22M12 2V7M12 17V22M17 2V7M17 17V22M4 22H20C21.1046 22 22 21.1046 22 20V4C22 2.89543 21.1046 2 20 2H4C2.89543 2 2 2.89543 2 4V20C2 21.1046 2.89543 22 4 22ZM11 10.5V13.5L13.5 12L11 10.5Z\" />",
|
320
320
|
"globe-world-earth": "<circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"M3 12H22\" /><path d=\"M12 2.2019C14.4744 4.72698 16 8.18526 16 11.9999C16 15.8145 14.4744 19.2728 12 21.7978\" /><path d=\"M12 2.2019C9.52563 4.72698 8 8.18526 8 11.9999C8 15.8145 9.52563 19.2728 12 21.7978\" />",
|
321
321
|
"coffee-tea-cup": "<path d=\"M17 6H17.9098C19.6165 6 21 7.38352 21 9.09017C21 10.2606 20.3387 11.3307 19.2918 11.8541L17 13.5M3 3V18C3 19.6569 4.34315 21 6 21H14C15.6569 21 17 19.6569 17 18V3H3Z\" />"
|
322
|
-
}
|
322
|
+
}
|
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