basicons_helper 1.0.1 → 1.0.2

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: 53ba6c0eb9657b42c513c5ed5034d8e19251247fa32cb4d04f187b2060cf690c
4
- data.tar.gz: 52ec8ddb8ae8038d1b99f052c1a69f19eb3b50778750c6b548c992b1a6541acb
3
+ metadata.gz: 3286b602cd05a507a8b4dc088a4e55fd99c9facc4abb2497e14c6ff2e471b883
4
+ data.tar.gz: fa64ec6a10023d8f6a514889dda070c9ff6b588c9b2aee286291ec52f5b73857
5
5
  SHA512:
6
- metadata.gz: fdde2fd90485b897aed6e0b612e7295d52e64bd6d756704c18f6d2683275f2f800f5a3b8b64815f806c9d2015c4338d40477cf2f9aab56a3087dce16c483d61a
7
- data.tar.gz: b62a521cf7d512ec77895f58096c1c47d1f8fdf2c4b1467992d420dd22a98cf83889eaa424c604b4471caaa10a3919de851c9b830be83642b688f0885520dd2b
6
+ metadata.gz: e808761a587496f06ad21df6c21ce9275f82a022d0b60ed153e998e79a6574c63410613867f8cdf83ebd2d52960056007d626ece2d370371e52050aca9a6695a
7
+ data.tar.gz: 57ea9530ac298e7266f42e60eb5c25ba954c43f1e6846ea5f01822faa67a460e7b80b4402036bc4f92c446a15c5b5b69858e0a2bd94536740dee6188a0942675
@@ -8,16 +8,14 @@ module BasiconsHelper
8
8
  def basicon(symbol, options = {})
9
9
  return '' if symbol.nil?
10
10
  cache_key = [symbol, options]
11
+
12
+ if tag = basicons_helper_cache[cache_key]
13
+ tag
14
+ else
15
+ icon = Basicons::Basicon.new(symbol, options)
16
+ tag = content_tag(:svg, icon.data.html_safe, icon.options).freeze
17
+ basicons_helper_cache[cache_key] = tag
18
+ tag
19
+ end
11
20
  end
12
21
  end
13
-
14
- # if tag = [octicons]_helper_cache[cache_key]
15
- # tag
16
- # else
17
- # icon = [Octicons]::Octicon.new(symbol, options)
18
-
19
- # tag = content_tag(:svg, icon.path.html_safe, icon.options).freeze # rubocop:disable Rails/OutputSafety
20
- # [octicons]_helper_cache[cache_key] = tag
21
- # tag
22
- # end
23
- # end
@@ -1,3 +1,3 @@
1
1
  module BasiconsHelper
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basicons_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
- - basicons's authors
7
+ - Basicons Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-07 00:00:00.000000000 Z
11
+ date: 2023-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: basicons