rubicons 0.10.0 → 0.11.0
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 +4 -4
- data/lib/rubicons/base_icon_set.rb +11 -1
- data/lib/rubicons/box_icons.rb +2 -2
- data/lib/rubicons/circum_icons.rb +2 -2
- data/lib/rubicons/heroicons.rb +9 -3
- data/lib/rubicons/heroicons2.rb +12 -2
- data/lib/rubicons/tabler_icons.rb +12 -2
- data/lib/rubicons/themify_icons.rb +7 -3
- data/lib/rubicons/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0397031d2f6c8cc5d66e9301f036e1778281109b9a69632d462ce55857c8ff5e'
|
|
4
|
+
data.tar.gz: d6c9b14b23715f34986ce01b364ee7f03dc26db322ab21b7b78ae291dab51bc0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63e55351941a5a37a0dfbac93e8a37eae0394cc32e6799da269fbc731f2409a9121e14376103eb73aa4ac5ffb262868056715ca8d6d2ee521060ae5843da806e
|
|
7
|
+
data.tar.gz: f6bf432b158d1eb9e3081022edc1c75b037ec68c4bbd25ec2ce86f0eba98ba05e9b1828f7851bc34a651e52d82babd263a21769ad79d02a6b7a27f41e3aa2a3b
|
|
@@ -25,7 +25,13 @@ module Rubicons
|
|
|
25
25
|
# @option options [Hash] :size_map custom size mapping
|
|
26
26
|
# @return [String] rendered SVG
|
|
27
27
|
def render_icon(name, icons_path, icon_klass, **options)
|
|
28
|
-
|
|
28
|
+
if block_given?
|
|
29
|
+
render_icon!(name, icons_path, icon_klass, **options) do |svg_element|
|
|
30
|
+
yield svg_element
|
|
31
|
+
end
|
|
32
|
+
else
|
|
33
|
+
render_icon!(name, icons_path, icon_klass, **options)
|
|
34
|
+
end
|
|
29
35
|
rescue
|
|
30
36
|
''
|
|
31
37
|
end
|
|
@@ -47,6 +53,10 @@ module Rubicons
|
|
|
47
53
|
svg_element['stroke'] = icon_klass.stroke_color
|
|
48
54
|
svg_element['fill'] = icon_klass.fill_color
|
|
49
55
|
|
|
56
|
+
if block_given?
|
|
57
|
+
yield svg_element
|
|
58
|
+
end
|
|
59
|
+
|
|
50
60
|
apply_options_to_svg(svg_element, options)
|
|
51
61
|
|
|
52
62
|
svg_element.to_s
|
data/lib/rubicons/box_icons.rb
CHANGED
data/lib/rubicons/heroicons.rb
CHANGED
|
@@ -23,11 +23,17 @@ module Rubicons
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def icon(name, **options)
|
|
26
|
-
BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
|
|
26
|
+
BaseIconSet.render_icon(name, ICONS_PATH, self, **options) do |svg_element|
|
|
27
|
+
svg_element.css('path').each { |path| path['stroke'] = 'currentColor' } if name.to_s.include?('outline')
|
|
28
|
+
svg_element.css('path').each { |path| path['fill'] = 'currentColor' } if name.to_s.include?('solid')
|
|
29
|
+
end
|
|
27
30
|
end
|
|
28
31
|
|
|
29
32
|
def icon!(name, **options)
|
|
30
|
-
BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
|
|
33
|
+
BaseIconSet.render_icon!(name, ICONS_PATH, self, **options) do |svg_element|
|
|
34
|
+
svg_element.css('path').each { |path| path['stroke'] = 'currentColor' } if name.to_s.include?('outline')
|
|
35
|
+
svg_element.css('path').each { |path| path['fill'] = 'currentColor' } if name.to_s.include?('solid')
|
|
36
|
+
end
|
|
31
37
|
end
|
|
32
38
|
|
|
33
39
|
def available_icons
|
|
@@ -35,7 +41,7 @@ module Rubicons
|
|
|
35
41
|
end
|
|
36
42
|
|
|
37
43
|
def fill_color
|
|
38
|
-
'
|
|
44
|
+
'none'
|
|
39
45
|
end
|
|
40
46
|
|
|
41
47
|
def stroke_color
|
data/lib/rubicons/heroicons2.rb
CHANGED
|
@@ -23,11 +23,21 @@ module Rubicons
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def icon(name, **options)
|
|
26
|
-
BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
|
|
26
|
+
BaseIconSet.render_icon(name, ICONS_PATH, self, **options) do |svg_element|
|
|
27
|
+
next unless name.to_s.include?('outline')
|
|
28
|
+
|
|
29
|
+
svg_element['stroke'] = 'currentColor'
|
|
30
|
+
svg_element['fill'] = 'none'
|
|
31
|
+
end
|
|
27
32
|
end
|
|
28
33
|
|
|
29
34
|
def icon!(name, **options)
|
|
30
|
-
BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
|
|
35
|
+
BaseIconSet.render_icon!(name, ICONS_PATH, self, **options) do |svg_element|
|
|
36
|
+
next unless name.to_s.include?('outline')
|
|
37
|
+
|
|
38
|
+
svg_element['stroke'] = 'currentColor'
|
|
39
|
+
svg_element['stroke'] = 'currentColor'
|
|
40
|
+
end
|
|
31
41
|
end
|
|
32
42
|
|
|
33
43
|
def available_icons
|
|
@@ -23,11 +23,21 @@ module Rubicons
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def icon(name, **options)
|
|
26
|
-
BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
|
|
26
|
+
BaseIconSet.render_icon(name, ICONS_PATH, self, **options) do |svg_element|
|
|
27
|
+
if name.to_s.include?('filled')
|
|
28
|
+
svg_element['fill'] = 'currentColor'
|
|
29
|
+
svg_element['stroke'] = 'none'
|
|
30
|
+
end
|
|
31
|
+
end
|
|
27
32
|
end
|
|
28
33
|
|
|
29
34
|
def icon!(name, **options)
|
|
30
|
-
BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
|
|
35
|
+
BaseIconSet.render_icon!(name, ICONS_PATH, self, **options) do |svg_element|
|
|
36
|
+
if name.to_s.include?('filled')
|
|
37
|
+
svg_element['fill'] = 'currentColor'
|
|
38
|
+
svg_element['stroke'] = 'none'
|
|
39
|
+
end
|
|
40
|
+
end
|
|
31
41
|
end
|
|
32
42
|
|
|
33
43
|
def available_icons
|
|
@@ -20,11 +20,15 @@ module Rubicons
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def icon(name, **options)
|
|
23
|
-
BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
|
|
23
|
+
BaseIconSet.render_icon(name, ICONS_PATH, self, **options) do |svg_element|
|
|
24
|
+
svg_element.css('path').each { |path| path['fill'] = 'currentColor' }
|
|
25
|
+
end
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
def icon!(name, **options)
|
|
27
|
-
BaseIconSet.render_icon!(name, ICONS_PATH, self,
|
|
29
|
+
BaseIconSet.render_icon!(name, ICONS_PATH, self, **options) do |svg_element|
|
|
30
|
+
svg_element.css('path').each { |path| path['fill'] = 'currentColor' }
|
|
31
|
+
end
|
|
28
32
|
end
|
|
29
33
|
|
|
30
34
|
def available_icons
|
|
@@ -32,7 +36,7 @@ module Rubicons
|
|
|
32
36
|
end
|
|
33
37
|
|
|
34
38
|
def fill_color
|
|
35
|
-
'
|
|
39
|
+
'none'
|
|
36
40
|
end
|
|
37
41
|
|
|
38
42
|
def stroke_color
|
data/lib/rubicons/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubicons
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.11.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- insomnius
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-07-
|
|
11
|
+
date: 2025-07-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Rubicons is a pure Ruby icon toolkit inspired by react-icons, offering
|
|
14
14
|
a simple and consistent way to include SVG-based icons in your Ruby applications
|