railsui_icon 1.1.0 → 1.1.1
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 +13 -6
- 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: 14738c847e9ef5bad1d94862883ad07fed5b21426081fcdee645057b4ab14e7f
|
4
|
+
data.tar.gz: 0e978fcf987391a6561165be63336e2b43f42598c6092c78ee31cdcdbf8eff4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29e4c13a2e624ad91cb34555d4f8bb7eb0b564dd0fc598134ecb77dcc5b1f1f90c33040c33f4ddd30919a6b3441b9bddf6b8d2e3284d14699f3d95d4edaec8c0
|
7
|
+
data.tar.gz: 9bf3cd2a99b18b21cb5c070939e3a62d0ec4517427de5eb3e70f6b1972e5618bda7d314f28eb68074f8b320090ea94e6d9c21f41cc90a7dd940e9d79709508cc
|
data/lib/railsui_icon/icon.rb
CHANGED
@@ -43,14 +43,11 @@ module RailsuiIcon
|
|
43
43
|
def render_custom_path(custom_path)
|
44
44
|
return warning if custom_path.blank?
|
45
45
|
|
46
|
-
#
|
47
|
-
|
48
|
-
|
49
|
-
# Extract file name from sanitized_path
|
50
|
-
file_name = File.basename(URI.parse(sanitized_path).path)
|
46
|
+
# Extract file name from custom_path
|
47
|
+
file_name = File.basename(URI.parse(custom_path).path)
|
51
48
|
|
52
49
|
# Attempt to find the asset in subdirectories of app/assets/images
|
53
|
-
asset_path = find_asset_path(
|
50
|
+
asset_path = find_asset_path(file_name)
|
54
51
|
|
55
52
|
raise ArgumentError, "Asset path cannot be found" if asset_path.nil?
|
56
53
|
|
@@ -72,6 +69,16 @@ module RailsuiIcon
|
|
72
69
|
|
73
70
|
private
|
74
71
|
|
72
|
+
def find_asset_path(file_name)
|
73
|
+
# Check in the main app/assets/images directory
|
74
|
+
path = Rails.root.join('app/assets/images', file_name)
|
75
|
+
return path.to_s if File.exist?(path)
|
76
|
+
|
77
|
+
# Check in any subdirectories within app/assets/images
|
78
|
+
Dir[Rails.root.join('app/assets/images/**/*', file_name)].first
|
79
|
+
end
|
80
|
+
private
|
81
|
+
|
75
82
|
def find_asset_path(file_name)
|
76
83
|
# Check in the main app/assets/images directory
|
77
84
|
path = Rails.root.join('app/assets/images', file_name)
|
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.1.
|
4
|
+
version: 1.1.1
|
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-09-
|
11
|
+
date: 2024-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|