railsui_icon 1.0.6 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44829505807edd1ed1f88d2902b3a099c6de1ead5364888886a0471f79a335e6
4
- data.tar.gz: 966a50bde90e86e71153610c4d02530c8d8480741863c13eeb52347ef87faa0f
3
+ metadata.gz: 10d02df8ac8f9e8898f39420db584fab2187233cc55eef5c3cdfefc6ff5baf82
4
+ data.tar.gz: ce8af1dee5d60a12730ea468ba48569873ec9192952ee416d350bacbbb58e36a
5
5
  SHA512:
6
- metadata.gz: 0c9fe909255c5c0939c97cc4088053fbaa65d6404111ae3dbbec5cbcf12731437acc2fd2907b3c296ab27b658eff7a862315c361954f22da31954345de60f315
7
- data.tar.gz: 1ac3f80191d4a29fe7a9e8d8d9ede3a59790ab7cadc3831a13a1d768715561914f4fa73c4e0ab34140aaaf44227be0c5fd41eef6e216fc8ad7603946ecb38a6d
6
+ metadata.gz: cb3f011b2da7e400190cf096cf009af5199dcafb88d7e05d2b399b90be0e0fe02f30cb422889ce6bd0756fb51471048d7d7716930d2fada2cf0337e8ad68f239
7
+ data.tar.gz: 94eda12d52a3d407d30dd100b793f95f1e2b82774e80077a9578f602d97f4df872da04781baba180649eb45c5a048599c0e13f2b3f6fd17059edc0f6fa1ad291
@@ -2,12 +2,11 @@
2
2
 
3
3
  module RailsuiIcon
4
4
  class Configuration
5
- attr_accessor :default_class, :default_variant, :custom_icon_paths
5
+ attr_accessor :default_class, :default_variant
6
6
 
7
7
  def initialize
8
8
  @default_class = ""
9
9
  @default_variant = :outline
10
- @custom_icon_paths = []
11
10
  end
12
11
  end
13
12
  end
@@ -19,10 +19,10 @@ module RailsuiIcon
19
19
  def resolve_custom_path(path)
20
20
  return unless path
21
21
 
22
- if Rails.application.config.assets.paths.any? { |p| path.start_with?(p) }
23
- path
22
+ if Rails.application.config.assets.paths.any? { |p| path.to_s.start_with?(p.to_s) }
23
+ path.to_s
24
24
  else
25
- ActionController::Base.helpers.asset_path(path)
25
+ ActionController::Base.helpers.asset_path(path.to_s)
26
26
  end
27
27
  end
28
28
  end
@@ -43,21 +43,19 @@ module RailsuiIcon
43
43
  def render_custom_path(custom_path)
44
44
  return warning if custom_path.blank?
45
45
 
46
+ asset_path = nil
47
+
46
48
  if defined?(Railsui::Engine) && Railsui::Engine.root.present?
47
49
  engine_asset_path = Railsui::Engine.root.join("app/assets/images#{custom_path}")
48
-
49
- if File.exist?(engine_asset_path)
50
- asset_path = engine_asset_path
51
- end
50
+ asset_path = engine_asset_path if File.exist?(engine_asset_path)
52
51
  end
53
52
 
54
- app_asset_path = Rails.root.join("app/assets/images#{custom_path}")
55
-
56
- if File.exist?(app_asset_path)
57
- asset_path = app_asset_path.to_s
53
+ unless asset_path
54
+ app_asset_path = Rails.root.join("app/assets/images#{custom_path}")
55
+ asset_path = app_asset_path.to_s if File.exist?(app_asset_path)
58
56
  end
59
57
 
60
- raise ArgumentError, "Asset path cannot be nil" if asset_path.nil?
58
+ raise ArgumentError, "Asset path cannot be found" if asset_path.nil?
61
59
 
62
60
  svg_content = File.read(asset_path)
63
61
  doc = Nokogiri::HTML::DocumentFragment.parse(svg_content)
@@ -1,3 +1,3 @@
1
1
  module RailsuiIcon
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.8"
3
3
  end
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.6
4
+ version: 1.0.8
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-08-16 00:00:00.000000000 Z
11
+ date: 2024-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails