rubicons 0.8.0 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6385de85756fd8f66e16c7e3d15778356e0a7d2b247da312912e445507331f1e
4
- data.tar.gz: 875ff8be08675acdb6711e238c5758e14ccd3417b6ddaabf4e7da0d908aae8bb
3
+ metadata.gz: 380effeb9f32c02b9441312e03d53ec5900aaa739c56a4258f58acd87bc7aeac
4
+ data.tar.gz: db49dadf41d98dcb866bcb84161ed0f089a4978967281c3996ff3857f9acd540
5
5
  SHA512:
6
- metadata.gz: 25084acd9a86d6013d1c2fc312e179cd0d8ad79d3ba53912f7808806913ee1d7e9f9adf87388ad9a49da6263b12050412a8d0d94823803fb72fc9e55150b708f
7
- data.tar.gz: 1147d7c2c46d10e2a76256b6a202ed5fc0d55ac5433e1703f4953bb5688cf338187b8c4383f02854d5614fb969629c7bc57a7138944be85d3f0e9a1ce9e4eb5f
6
+ metadata.gz: 3ddc8789c29c06c4c2d1fd41ffc6df209aed3c3e1a9b3a5408a21c29ead518e66f2cb09e249d3111e2272ece979cccc17d03a624fbf5f184beb446aba22cc566
7
+ data.tar.gz: ed3483118239495e38b646e81fe9d568c8aa7f7ef179815dbf4acae8a436ae82c2ff404dddd18ffde5e345a972cf2b0fdd57d6a6f47c86261e34c0ba23337560
@@ -24,13 +24,13 @@ module Rubicons
24
24
  # @option options [String] :class CSS classes to add
25
25
  # @option options [Hash] :size_map custom size mapping
26
26
  # @return [String] rendered SVG
27
- def render_icon(name, icons_path, **options)
28
- render_icon!(name, icons_path, **options)
27
+ def render_icon(name, icons_path, icon_klass, **options)
28
+ render_icon!(name, icons_path, icon_klass, **options)
29
29
  rescue
30
30
  ''
31
31
  end
32
32
 
33
- def render_icon!(name, icons_path, **options)
33
+ def render_icon!(name, icons_path, icon_klass, **options)
34
34
  icon_path = File.join(icons_path, "#{name}.svg")
35
35
  raise ArgumentError, "Icon '#{name}' not found" unless File.exist?(icon_path)
36
36
 
@@ -44,6 +44,8 @@ module Rubicons
44
44
 
45
45
  svg_element['width'] = svg_size
46
46
  svg_element['height'] = svg_size
47
+ svg_element['stroke'] = icon_klass.stroke_color
48
+ svg_element['fill'] = icon_klass.fill_color
47
49
 
48
50
  apply_options_to_svg(svg_element, options)
49
51
 
@@ -23,11 +23,19 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
+ end
32
+
33
+ def fill_color
34
+ 'currentColor'
35
+ end
36
+
37
+ def stroke_color
38
+ 'none'
31
39
  end
32
40
 
33
41
  def available_icons
@@ -23,11 +23,19 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
+ end
32
+
33
+ def fill_color
34
+ 'none'
35
+ end
36
+
37
+ def stroke_color
38
+ 'currentColor'
31
39
  end
32
40
 
33
41
  def available_icons
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'none'
39
+ end
40
+
41
+ def stroke_color
42
+ 'currentColor'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'none'
39
+ end
40
+
41
+ def stroke_color
42
+ 'currentColor'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -22,16 +22,24 @@ module Rubicons
22
22
  end
23
23
 
24
24
  def icon(name, **options)
25
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
25
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
26
26
  end
27
27
 
28
28
  def icon!(name, **options)
29
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
29
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
30
30
  end
31
31
 
32
32
  def available_icons
33
33
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
34
34
  end
35
+
36
+ def fill_color
37
+ 'none'
38
+ end
39
+
40
+ def stroke_color
41
+ 'currentColor'
42
+ end
35
43
  end
36
44
  end
37
45
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -22,16 +22,24 @@ module Rubicons
22
22
  end
23
23
 
24
24
  def icon(name, **options)
25
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
25
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
26
26
  end
27
27
 
28
28
  def icon!(name, **options)
29
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
29
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
30
30
  end
31
31
 
32
32
  def available_icons
33
33
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
34
34
  end
35
+
36
+ def fill_color
37
+ 'currentColor'
38
+ end
39
+
40
+ def stroke_color
41
+ 'none'
42
+ end
35
43
  end
36
44
  end
37
45
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'none'
39
+ end
40
+
41
+ def stroke_color
42
+ 'currentColor'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -20,16 +20,24 @@ module Rubicons
20
20
  end
21
21
 
22
22
  def icon(name, **options)
23
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
23
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
24
24
  end
25
25
 
26
26
  def icon!(name, **options)
27
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
27
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
28
28
  end
29
29
 
30
30
  def available_icons
31
31
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
32
32
  end
33
+
34
+ def fill_color
35
+ 'currentColor'
36
+ end
37
+
38
+ def stroke_color
39
+ 'none'
40
+ end
33
41
  end
34
42
  end
35
43
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubicons
4
- VERSION = '0.8.0'
4
+ VERSION = '0.10.0'
5
5
  end
@@ -23,16 +23,24 @@ module Rubicons
23
23
  end
24
24
 
25
25
  def icon(name, **options)
26
- BaseIconSet.render_icon(name, ICONS_PATH, **options)
26
+ BaseIconSet.render_icon(name, ICONS_PATH, self, **options)
27
27
  end
28
28
 
29
29
  def icon!(name, **options)
30
- BaseIconSet.render_icon!(name, ICONS_PATH, **options)
30
+ BaseIconSet.render_icon!(name, ICONS_PATH, self, **options)
31
31
  end
32
32
 
33
33
  def available_icons
34
34
  @available_icons ||= BaseIconSet.available_icons(ICONS_PATH)
35
35
  end
36
+
37
+ def fill_color
38
+ 'currentColor'
39
+ end
40
+
41
+ def stroke_color
42
+ 'none'
43
+ end
36
44
  end
37
45
  end
38
46
  end
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.8.0
4
+ version: 0.10.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-04-30 00:00:00.000000000 Z
11
+ date: 2025-07-19 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