classy-yaml 1.6.0 → 1.6.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 +4 -4
- data/lib/classy/yaml/tag_helper.rb +19 -0
- data/lib/classy/yaml/version.rb +1 -1
- data/lib/classy/yaml.rb +4 -19
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e566d60844937bb2310dc723b7efd040757808eca4e3960f37d264d31f5aa1e5
|
4
|
+
data.tar.gz: 2cf749c910728ed927143c971dc1bce2f57fc67e53bb660914c09f525b3bc3d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f93a94f2703bc0827427253de91a1ce26776d4d148749baf696af408e37e5563b042bb6e3f08b01d6400101b39526467ae2f187e72c12ae351ef6a12e98174f8
|
7
|
+
data.tar.gz: 64a64c77d4260322b1cc2e967a2a71eb2bad2710f0d95a4b40189fb0631908134351ae6bc9e54c8b99b921d2e560b9baf19f6d7ff2f34e9c50a6cc52984168f0
|
@@ -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_key] = yass(val)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
super(options, escape)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/classy/yaml/version.rb
CHANGED
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
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
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.
|
4
|
+
version: 1.6.2
|
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-
|
11
|
+
date: 2025-08-13 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
|