railsui_icon 1.0.2 → 1.0.3
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/railsui_icon/icon.rb +16 -2
- data/lib/railsui_icon/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: d45845912b9f9db2bd1ce2c19f8953fb20ed205b9156af38036c208710c1b7bc
|
4
|
+
data.tar.gz: 45dd58a2aeaa6ddcb07371f41d28e71a2edbec951197cb1c0d526789a0677d02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff42b7699dbc33087a3cdd3fcc4b14b9ba35b81f10308f611f430271232b1ae6ad36e6557752dfd8d9ea35bd009b8de25ded5395f3d76386931b935aa7467d31
|
7
|
+
data.tar.gz: 1fba9f974a50d891eab7953a6d27adfde80549fca92607f3def566646606046610cc4a86e5ae98dbf564e80d79f4f0a85ebd91d4879d10629f7f0d37df2705a5
|
data/lib/railsui_icon/icon.rb
CHANGED
@@ -41,9 +41,23 @@ module RailsuiIcon
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def render_custom_path(custom_path)
|
44
|
-
|
45
|
-
|
44
|
+
# Check the engine's asset path first
|
45
|
+
engine_asset_path = Railsui::Engine.root.join("app/assets/images/#{custom_path}")
|
46
|
+
|
47
|
+
# Check the main app's asset path
|
48
|
+
app_asset_path = Rails.root.join("app/assets/images/#{custom_path}")
|
49
|
+
|
50
|
+
# Determine which path exists
|
51
|
+
asset_path = if File.exist?(engine_asset_path)
|
52
|
+
engine_asset_path
|
53
|
+
elsif File.exist?(app_asset_path)
|
54
|
+
app_asset_path
|
55
|
+
else
|
56
|
+
Rails.logger.error "Asset not found: #{engine_asset_path} and #{app_asset_path}"
|
57
|
+
return warning
|
58
|
+
end
|
46
59
|
|
60
|
+
svg_content = File.read(asset_path)
|
47
61
|
doc = Nokogiri::HTML::DocumentFragment.parse(svg_content)
|
48
62
|
svg = doc.at_css('svg')
|
49
63
|
|
data/lib/railsui_icon/version.rb
CHANGED