ror_icons 0.1.0 → 0.1.1

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: 53e5ea69ccc43b7708b983ea91eba9098fff5adf225d4b9dcc9e449d84a95806
4
- data.tar.gz: de562d6b520c71cfbc93eac7a0f02059af356af65bfd467e63350d428c1337b2
3
+ metadata.gz: 322c9a8d7e92095a15202b236875b0b5eaa3d259eeb6ed8cbd4aa8f419102db8
4
+ data.tar.gz: 7f0b6b61c78bbb7ff670b43a619b450fbb10fe48e8840929696fa0dc2d195582
5
5
  SHA512:
6
- metadata.gz: 754e1f80c0ec304776965fb7c24b232f42023fb726aeee37fb2cb74f406370235f5156dd07b827c161fa7395977130df700f3862eb79d84e4086b6db9d0c632b
7
- data.tar.gz: c7c0cb789351d3a5db080c1e633337ae30d7f0ed7f282d0bb5c3255f2491cfaecaf7b0549506270dd0afbbec9f98333a0a2e24043db652cc8b1f0d2453e267e4
6
+ metadata.gz: c0374142c5d29bfb9474c855eb7c1d0c4bddc5f5d3cf45ebd8991ea4d92f2eec14f9989b4cd87399c2c8b30cfd1280d92a1202aa4a53a34fbdb63eeb7294d13d
7
+ data.tar.gz: 86e6b8d1d4a166e22933005ca68a4324d7868fa7aa209960143c5f354dcb965616b68b26e8b723fc6c20ebef3ed87330258fd51c2230fc6e9253752170304520
@@ -15,16 +15,14 @@ module RorIcons
15
15
  path = File.join(ICON_ROOT, size.to_s, variant.to_s, "#{icon_name}.svg")
16
16
  raise ArgumentError, "Icon not found: #{path}" unless File.exist?(path)
17
17
 
18
- svg = if defined?(Rails) && Rails.respond_to?(:cache)
19
- Rails.cache.fetch(path) { File.read(path) }
20
- else
21
- File.read(path)
22
- end
18
+ svg = (defined?(Rails) && Rails.respond_to?(:cache)) ? Rails.cache.fetch(path) { File.read(path) } : File.read(path)
23
19
  doc = Nokogiri::HTML::DocumentFragment.parse(svg)
24
20
  svg_node = doc.at_css("svg")
21
+ raise "SVG does not contain <svg> node" unless svg_node
22
+
23
+ svg_node["width"] = size.to_s
24
+ svg_node["height"] = size.to_s
25
25
 
26
- svg_node["width"] = size
27
- svg_node["height"] = size
28
26
  svg_node["class"] = css_class if css_class
29
27
  attrs.each { |k, v| svg_node[k.to_s] = v }
30
28
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RorIcons
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ror_icons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luka Tchelidze
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '7.1'
41
- description: Provides Heroicons SVG helpers for Rails views, similar to react-icons.
41
+ description: Provides HeroIcons SVG helpers for Rails views, similar to react-icons.
42
42
  email:
43
43
  - tchelidzeluca@gmail.com
44
44
  executables: []