classy-yaml 1.6.0 → 1.6.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: 352e03027c4cfd4154d22f4d26aa5cc0faa040a9815476505a3167487adcd0ab
4
- data.tar.gz: 5f80b9e47137978a7d252f6ff8a83a6d43cbaa658d424af5c8bab962b8c1fc56
3
+ metadata.gz: 9290a4e662dd8d535fcaa8027679d3f9429fbadc848d22122be32e2816c60179
4
+ data.tar.gz: d17e3d9b702997ee5bc75d1bc8d7bc0d8819f3892176c6b26a0a2346487e991e
5
5
  SHA512:
6
- metadata.gz: 243dca26cd467edbbc0d1df13fbdd297491015779cdab12f8c339bec63186cb234957a88d9b00e341fd83b6f96994a4f9761716d9b9aaf25992020bc561a1aef
7
- data.tar.gz: b2e9b69ae589341503b21ce6f57b999029ebebaf77ef5b794c9759a93a37efdf5d7a98fd416d76dd6a3b4e41511c37d453994134d01e3794d9c40b2edc7dd270
6
+ metadata.gz: 7b5971bbb9f71d9bc5f8a99791a89180c95ac752dac26a11d2560255d32c1a0f57ed2347c4df6caefccadd310ed1db937445a0c2e7edfa734603d51889ed814c
7
+ data.tar.gz: 854882375942f68865a146d84c1365a137307b4973bd42358491149b783959407e32aa07700e28f6321a0e9250273346932764320a72f136ab69240d4cb941f7
@@ -0,0 +1,19 @@
1
+ module Classy
2
+ module Yaml
3
+ module TagHelper
4
+ include Classy::Yaml::Helpers
5
+
6
+ def tag_options(options, escape = true)
7
+ if options
8
+ class_key = options.key?(:class) ? :class : "class"
9
+ options = options.dup
10
+ val = options[class_key]
11
+ if val.is_a?(Symbol) || val.is_a?(Hash) || val.is_a?(Array)
12
+ options[:class] = yass(val)
13
+ end
14
+ end
15
+ super(options, escape)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,5 +1,5 @@
1
1
  module Classy
2
2
  module Yaml
3
- VERSION = "1.6.0"
3
+ VERSION = "1.6.1"
4
4
  end
5
5
  end
data/lib/classy/yaml.rb CHANGED
@@ -88,25 +88,10 @@ module Classy
88
88
  private
89
89
 
90
90
  def self.apply_tag_helper_override
91
- return unless defined?(ActionView::Helpers::TagHelper)
92
-
93
- # Override the TagBuilder class which is what the tag method returns
94
- ActionView::Helpers::TagHelper::TagBuilder.class_eval do
95
- unless method_defined?(:classy_yaml_original_tag_options)
96
- alias_method :classy_yaml_original_tag_options, :tag_options
97
-
98
- def tag_options(options, escape = true)
99
- if options
100
- class_key = options.key?(:class) ? :class : "class"
101
- options = options.dup
102
- val = options[class_key]
103
- if val.is_a?(Symbol) || val.is_a?(Hash) || val.is_a?(Array)
104
- options[:class] = yass(val)
105
- end
106
- end
107
- classy_yaml_original_tag_options(options, escape)
108
- end
109
- end
91
+ require "classy/yaml/tag_helper"
92
+
93
+ ActiveSupport.on_load(:action_view) do
94
+ ActionView::Helpers::TagHelper::TagBuilder.prepend(Classy::Yaml::TagHelper)
110
95
  end
111
96
  end
112
97
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classy-yaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tonksthebear
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-06 00:00:00.000000000 Z
11
+ date: 2025-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -151,6 +151,7 @@ files:
151
151
  - lib/classy/yaml/engine.rb
152
152
  - lib/classy/yaml/helpers.rb
153
153
  - lib/classy/yaml/invalid_key_error.rb
154
+ - lib/classy/yaml/tag_helper.rb
154
155
  - lib/classy/yaml/version.rb
155
156
  - lib/tasks/classy/yaml_tasks.rake
156
157
  homepage: https://github.com/Tonksthebear/classy-yaml