phlex 2.0.0.beta1 → 2.0.0.beta2
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/phlex/element_clobbering_guard.rb +5 -3
- data/lib/phlex/elements.rb +10 -10
- data/lib/phlex/helpers.rb +2 -0
- data/lib/phlex/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46379514e0705957409d87f74668c2f012e03d5a48fe14f41b4100172b0672c0
|
4
|
+
data.tar.gz: c4ddfa6b1c8eabfc66534abb52ca6fbe543db4d41ddf529b50fc8d0cd3393f63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aa416b84741e68ee9429b11c2cd2fc9dc2986ae4cc15eefff126b5f53e177aad9129cdc1349e827e54aef5c5a26f08f12017e3d200b98c5930130c4c13883fc
|
7
|
+
data.tar.gz: fc0cd1de6ab7d6a6f1b76447fad84a263c9cda0ce7e0a9f4313b579c38b7246a4704a02fd183bc0b29bdc171f374070aed0e0c2933f6e06388e58696f58f2565
|
@@ -6,9 +6,11 @@ module Phlex::ElementClobberingGuard
|
|
6
6
|
if method_name[0] == "_" && __element_method__?(method_name[1..].to_sym)
|
7
7
|
raise Phlex::NameError.new("👋 Redefining the method `#{name}##{method_name}` is not a good idea.")
|
8
8
|
elsif method_name == :view_template
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
location = instance_method(method_name).source_location[0]
|
10
|
+
|
11
|
+
if location[0] in "/" | "."
|
12
|
+
Phlex.__expand_attribute_cache__(location)
|
13
|
+
end
|
12
14
|
else
|
13
15
|
super
|
14
16
|
end
|
data/lib/phlex/elements.rb
CHANGED
@@ -64,23 +64,23 @@ module Phlex::Elements
|
|
64
64
|
if original_length == buffer.bytesize
|
65
65
|
case content
|
66
66
|
when String
|
67
|
-
buffer << Phlex::Escape.html_escape(content)
|
67
|
+
buffer << ::Phlex::Escape.html_escape(content)
|
68
68
|
when Symbol
|
69
|
-
buffer << Phlex::Escape.html_escape(content.name)
|
69
|
+
buffer << ::Phlex::Escape.html_escape(content.name)
|
70
70
|
when nil
|
71
71
|
nil
|
72
|
-
when Phlex::SGML::SafeObject
|
72
|
+
when ::Phlex::SGML::SafeObject
|
73
73
|
buffer << content.to_s
|
74
74
|
else
|
75
75
|
if (formatted_object = format_object(content))
|
76
|
-
buffer << Phlex::Escape.html_escape(formatted_object)
|
76
|
+
buffer << ::Phlex::Escape.html_escape(formatted_object)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
81
|
buffer << "</#{tag}>"
|
82
82
|
else # without content
|
83
|
-
buffer << "<#{tag}" << (Phlex::ATTRIBUTE_CACHE[attributes] ||= __attributes__(attributes)) << "></#{tag}>"
|
83
|
+
buffer << "<#{tag}" << (::Phlex::ATTRIBUTE_CACHE[attributes] ||= __attributes__(attributes)) << "></#{tag}>"
|
84
84
|
end
|
85
85
|
else # without attributes
|
86
86
|
if block_given # with content block
|
@@ -91,16 +91,16 @@ module Phlex::Elements
|
|
91
91
|
if original_length == buffer.bytesize
|
92
92
|
case content
|
93
93
|
when String
|
94
|
-
buffer << Phlex::Escape.html_escape(content)
|
94
|
+
buffer << ::Phlex::Escape.html_escape(content)
|
95
95
|
when Symbol
|
96
|
-
buffer << Phlex::Escape.html_escape(content.name)
|
96
|
+
buffer << ::Phlex::Escape.html_escape(content.name)
|
97
97
|
when nil
|
98
98
|
nil
|
99
|
-
when Phlex::SGML::SafeObject
|
99
|
+
when ::Phlex::SGML::SafeObject
|
100
100
|
buffer << content.to_s
|
101
101
|
else
|
102
102
|
if (formatted_object = format_object(content))
|
103
|
-
buffer << Phlex::Escape.html_escape(formatted_object)
|
103
|
+
buffer << ::Phlex::Escape.html_escape(formatted_object)
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
@@ -152,7 +152,7 @@ module Phlex::Elements
|
|
152
152
|
end
|
153
153
|
|
154
154
|
if attributes.length > 0 # with attributes
|
155
|
-
buffer << "<#{tag}" << (Phlex::ATTRIBUTE_CACHE[attributes] ||= __attributes__(attributes)) << ">"
|
155
|
+
buffer << "<#{tag}" << (::Phlex::ATTRIBUTE_CACHE[attributes] ||= __attributes__(attributes)) << ">"
|
156
156
|
else # without attributes
|
157
157
|
buffer << "<#{tag}>"
|
158
158
|
end
|
data/lib/phlex/helpers.rb
CHANGED
data/lib/phlex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phlex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Drapper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A high-performance view framework optimised for fun.
|
14
14
|
email:
|