railsui_icon 1.0.2 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/railsui_icon/icon.rb +19 -2
- data/lib/railsui_icon/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: f2b20a83d52f2e74a09b0cb4adea7b985e58a245838416527db32698446dce8b
|
4
|
+
data.tar.gz: dcbd25c4c0cb05a1adb68ca4f1da4cf6cb96c77393e741e702fbbf805258b825
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf94910fd60faa96cad929156fd4176c5d48936be7e713eac65262d8260937446d1b6ec58f4af462263bd798969930696c3ce19ed5b603c60506865ef7133969
|
7
|
+
data.tar.gz: e1dd62964ec1ec79bf5cfbbac56e94d96dacfaae9d0aa3021a34cf8503456a8c23d1862653519a3d043748da593d221e019de0eed8e32130e36ad5fb5506cace
|
data/lib/railsui_icon/icon.rb
CHANGED
@@ -15,6 +15,7 @@ module RailsuiIcon
|
|
15
15
|
|
16
16
|
def render
|
17
17
|
if custom_path
|
18
|
+
puts "🔥🔥🔥🔥🔥#{custom_path}"
|
18
19
|
render_custom_path(custom_path)
|
19
20
|
else
|
20
21
|
render_standard_icon
|
@@ -41,9 +42,25 @@ module RailsuiIcon
|
|
41
42
|
end
|
42
43
|
|
43
44
|
def render_custom_path(custom_path)
|
44
|
-
|
45
|
-
|
45
|
+
return warning if custom_path.blank?
|
46
|
+
|
47
|
+
if defined?(Railsui::Engine) && Railsui::Engine.root.present?
|
48
|
+
engine_asset_path = Railsui::Engine.root.join("app/assets/images#{custom_path}")
|
49
|
+
|
50
|
+
if File.exist?(engine_asset_path)
|
51
|
+
asset_path = engine_asset_path
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
app_asset_path = Rails.root.join("app/assets/images#{custom_path}")
|
46
56
|
|
57
|
+
if File.exist?(app_asset_path)
|
58
|
+
asset_path = app_asset_path
|
59
|
+
end
|
60
|
+
|
61
|
+
raise ArgumentError, "Asset path cannot be nil" if asset_path.nil?
|
62
|
+
|
63
|
+
svg_content = File.read(asset_path)
|
47
64
|
doc = Nokogiri::HTML::DocumentFragment.parse(svg_content)
|
48
65
|
svg = doc.at_css('svg')
|
49
66
|
|
data/lib/railsui_icon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: railsui_icon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Leverenz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|