avo-icons 0.1.3 → 0.1.5

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: 525a914b2d1f22bfdcb5614898d5c47bbac27b63001c952a50af8daa6019124d
4
- data.tar.gz: 3dd64eefe08f79dc533b071bb2c92bdbd3e3e79baaeadf6f8834bee77b477463
3
+ metadata.gz: '0804ba0dacb221d4b02e49d550e5c2a1e58527f2dffe5bf21779f37ed6359655'
4
+ data.tar.gz: 0b9ad1b3eefe21c05f02d3bed0c0733a73fa6dadead0dae0cacb3eb216e9fc89
5
5
  SHA512:
6
- metadata.gz: 035e4f25ef4bea432d396cbee2d5bb02d80bf579fe14ca07600fb3263942b7169fe6050c6203f54e93eef104ded3d4a8fc796fe158cbc9e269defade4216656b
7
- data.tar.gz: e8f3c860eb615c3618ae264a1739ee4c375f20636e1d71fb055292363d597e5f3a0d5a19613cc4b1e77f02957e56795123c02be6c059660c6e592d8edca1e88c
6
+ metadata.gz: 229478a6201fe6a21ae21ab5eefdf62d1ec46a46bf96209790d2a8affa2e6ca2d9c7dc2771c2a4f2f13594b86d4a98f436e7eb23d1e276e4a5de1b9adfa1fdfd
7
+ data.tar.gz: 7db4d43b9986e37c0ef604ee25cb147efc0fd8f7f516eb13aca39d3f8e6764034ece58d79faada6c459e700bca7f409187951485d9ad06b9121ca403b5d6cda2
@@ -21,4 +21,3 @@ module Avo
21
21
  end
22
22
  end
23
23
  end
24
-
@@ -24,8 +24,9 @@ module Avo
24
24
  # https://github.com/jamesmartin/inline_svg/blob/main/lib/inline_svg/action_view/helpers.rb#L61
25
25
  def placeholder(filename)
26
26
  css_class = "avo-missing-svg"
27
+ escaped_filename = ERB::Util.html_escape_once(filename.to_s)
27
28
  missing_icon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-ice-cream-off"><path stroke="none" d="M0 0h24v24H0z" fill="none" /><path d="M12 21.5v-4.5" /><path d="M8 8v9h8v-1m0 -4v-5a4 4 0 0 0 -7.277 -2.294" /><path d="M8 10.5l1.74 -.76m2.79 -1.222l3.47 -1.518" /><path d="M8 14.5l4.488 -1.964" /><path d="M3 3l18 18" /></svg>'
28
- "<div data-tippy='tooltip' class='#{css_class}' style='width: 2rem; height: 2rem; color: #ef4444;' title='SVG file not found: #{filename}'><!-- SVG file not found: '#{ERB::Util.html_escape_once(filename)}' -->#{missing_icon}</div>".html_safe
29
+ "<div data-tippy='tooltip' class='#{css_class}' style='width: 2rem; height: 2rem; color: #ef4444;' title='SVG file not found: #{escaped_filename}'><!-- SVG file not found: '#{escaped_filename}' -->#{missing_icon}</div>".html_safe
29
30
  end
30
31
 
31
32
  # Taken from the original library
@@ -40,4 +41,3 @@ module Avo
40
41
  end
41
42
  end
42
43
  end
43
-
@@ -37,7 +37,7 @@ module Avo
37
37
  Avo::Icons.root.join("assets", "svgs", "heroicons", "mini", @filename),
38
38
  Avo::Icons.root.join("assets", "svgs", "heroicons", "micro", @filename),
39
39
  # Add all paths from Rails including engines
40
- *Rails.application.config.assets&.paths&.map { |path| File.join(path, @filename) }
40
+ *Rails.application.config.try(:assets)&.paths&.map { |path| File.join(path, @filename) }
41
41
  ]
42
42
 
43
43
  # Add custom paths from configuration
@@ -53,6 +53,9 @@ module Avo
53
53
  end
54
54
 
55
55
  def default_strategy
56
+ # Return nil if the app doesn't have assets configured
57
+ return unless Rails.application.config.respond_to?(:assets)
58
+
56
59
  # If the app uses Propshaft, grab it from there
57
60
  if defined?(Propshaft)
58
61
  asset_path = ::Rails.application.assets.load_path.find(@filename)
@@ -73,4 +76,3 @@ module Avo
73
76
  end
74
77
  end
75
78
  end
76
-
@@ -1,5 +1,5 @@
1
1
  module Avo
2
2
  module Icons
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
data/lib/avo/icons.rb CHANGED
@@ -12,7 +12,7 @@ module Avo
12
12
  attr_accessor :cached_svgs
13
13
 
14
14
  def root
15
- Pathname.new File.expand_path('..', __dir__)
15
+ Pathname.new File.expand_path("..", __dir__)
16
16
  end
17
17
 
18
18
  def configuration
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avo-icons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Bob
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-04-17 00:00:00.000000000 Z
12
+ date: 2026-06-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: inline_svg