octicons_helper 11.0.0.pre.7418f68 → 11.0.0

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: ade298fabdf224dd75c369f3fee715bed25168b7ed5da616afe6d5d8c566673d
4
- data.tar.gz: 538cf02d5fa93dc2c6e7d6c9180ae621d8965eb8ce95686d6810d07cb7b70017
3
+ metadata.gz: f69573ee37216cd4be748af8d93aa895f72c768e3487d8696eadd26954a354f5
4
+ data.tar.gz: 3e98c451b042c70fbd602ef530e9b75f38f8c67fad1966e3eb83a6c769a18f7c
5
5
  SHA512:
6
- metadata.gz: db544bd16cb63430b61a5f877c30c9f7d3c2b82bce0d1f5d63546147f1f77df90fc3c544ad4fa0075aaf02659e7835b426f20b232758c6a6d686cb5e6492a604
7
- data.tar.gz: c6207cc4301630ba98158ad714cf8a78f513e6308afd80f0e7108513d9eb5c33bbdae810451c0c0ee54172dda000f6828e7187a2ddd73a5b59e9cca519721bbe
6
+ metadata.gz: c170d24dfda3f072287f1ec1518b0ec39bddf3e2d1392ac3ab5c49296f7c3d88fc4c047beae548b462007f2eb9bddb139ace239f938e43302a0abcf21306c3ab
7
+ data.tar.gz: 7279b247ef23117af757ff00a3c9c48ef81769d971c0b2f839d49ac0e0b24e3c37d1f5fd2c511d0e1338083f06a9f6bb2c3a54953d38418345d71a377f6a67d4
@@ -2,13 +2,23 @@ require "octicons"
2
2
  require "action_view"
3
3
 
4
4
  module OcticonsHelper
5
-
6
5
  include ActionView::Helpers::TagHelper
7
6
 
7
+ mattr_accessor :octicons_helper_cache, default: {}
8
+
8
9
  def octicon(symbol, options = {})
9
10
  return "" if symbol.nil?
10
11
 
11
- icon = Octicons::Octicon.new(symbol, options)
12
- content_tag(:svg, icon.path.html_safe, icon.options) # rubocop:disable Rails/OutputSafety
12
+ cache_key = [symbol, options].to_s
13
+
14
+ if octicons_helper_cache[cache_key]
15
+ octicons_helper_cache[cache_key]
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
13
23
  end
14
24
  end
@@ -1,3 +1,3 @@
1
1
  module OcticonsHelper
2
- VERSION = "11.0.0.pre.7418f68".freeze
2
+ VERSION = "11.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octicons_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.0.0.pre.7418f68
4
+ version: 11.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-01 00:00:00.000000000 Z
11
+ date: 2020-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octicons
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 11.0.0.pre.7418f68
19
+ version: 11.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 11.0.0.pre.7418f68
26
+ version: 11.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -469,9 +469,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
469
469
  version: '0'
470
470
  required_rubygems_version: !ruby/object:Gem::Requirement
471
471
  requirements:
472
- - - ">"
472
+ - - ">="
473
473
  - !ruby/object:Gem::Version
474
- version: 1.3.1
474
+ version: '0'
475
475
  requirements: []
476
476
  rubygems_version: 3.0.1
477
477
  signing_key: