phlex 1.8.3 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of phlex might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -1
- data/CHANGELOG.md +12 -3
- data/CONTRIBUTING.md +12 -2
- data/Gemfile +1 -0
- data/gd/phlex/callable.rb +18 -0
- data/gd/phlex/sgml/attributes.rb +79 -0
- data/gd/support/helper.rb +23 -0
- data/lib/phlex/context.rb +6 -2
- data/lib/phlex/elements.rb +2 -2
- data/lib/phlex/html/standard_elements.rb +13 -6
- data/lib/phlex/sgml.rb +18 -11
- data/lib/phlex/svg/standard_elements.rb +25 -25
- data/lib/phlex/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b68a563745c2782c8fa9f864f1d00994d6f5b3b1ffb92d651a52875386587fb
|
4
|
+
data.tar.gz: 4e272a581c83f91a4ba0e0a382bb2f54f3c7b3918e88b6c232d503f407046e75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4db12efca6e80561f266b3118a401bb81c2859a5b6b4f3f6db301ea711c468b1ad426a59db9dc0e9ea02056e60e7c325223051dd2e4a2309dc14d1ffc45410ac
|
7
|
+
data.tar.gz: 7c6fe13e7fa6e88d4c1857d4746faae3b622586823cfe6e64a71706efa9aca7ed1e82c9c13f5916f1c6780ab914d6a3576d4cd8571df0df249767bbf0c3b86de
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,19 +2,28 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
4
4
|
|
5
|
-
## [1.
|
5
|
+
## [1.9.0] 2024-11-24
|
6
|
+
|
7
|
+
- Improved documentation
|
8
|
+
- Fixed an issue with flushing to the buffer while capturing
|
9
|
+
- Added `<canvas>` element
|
10
|
+
- Very minor performance improvements by using `block` instead of `block_given?` where a block has already been captured
|
11
|
+
- `Integer` objects are now handled by the `format_object` method, which you can override to customise how various objects are rendered
|
12
|
+
- You can now use `render` with `String` and `Method` objects
|
13
|
+
|
14
|
+
## [1.8.1] 2023-04-19
|
6
15
|
|
7
16
|
### Fixed
|
8
17
|
|
9
18
|
- Rendering a component with a false `render?` predicate should return an empty String rather than `nil`.
|
10
19
|
|
11
|
-
## [1.8.0]
|
20
|
+
## [1.8.0] 2023-04-19
|
12
21
|
|
13
22
|
### Changed
|
14
23
|
|
15
24
|
- Support `Integer` and `Float` attribute values, and fall back to calling `to_str` on other objects.
|
16
25
|
|
17
|
-
## [1.7.0]
|
26
|
+
## [1.7.0] 2023-04-18
|
18
27
|
|
19
28
|
### Added
|
20
29
|
|
data/CONTRIBUTING.md
CHANGED
@@ -14,9 +14,19 @@ Phlex is incredibly complex and requires a lot of meta-programming but when you
|
|
14
14
|
|
15
15
|
## Tests
|
16
16
|
|
17
|
-
|
17
|
+
New tests should be written using [GreenDots](https://github.com/joeldrapper/green_dots) and placed in the `gd` folder. You can run these tests with:
|
18
18
|
|
19
|
-
|
19
|
+
```
|
20
|
+
bundle exec gd gd
|
21
|
+
```
|
22
|
+
|
23
|
+
Joel maintains GreenDots itself, so if you run into any issues, please reach out to him by creating an issue in the GreenDots repo so he can improve the framework.
|
24
|
+
|
25
|
+
Previously, we used **[Sus](https://github.com/ioquatix/sus)**. Sus tests are in the `test` folder and can be run with:
|
26
|
+
|
27
|
+
```
|
28
|
+
bundle exec sus
|
29
|
+
```
|
20
30
|
|
21
31
|
## Documentation
|
22
32
|
|
data/Gemfile
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Example
|
4
|
+
include Phlex::Callable
|
5
|
+
|
6
|
+
def call
|
7
|
+
"Hello, world!"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def example
|
12
|
+
Example.new
|
13
|
+
end
|
14
|
+
|
15
|
+
test "to_proc" do
|
16
|
+
expect(example.to_proc).to_be_a Proc
|
17
|
+
expect(example.to_proc.call) == "Hello, world!"
|
18
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
include TestHelper
|
4
|
+
|
5
|
+
class ToStrable
|
6
|
+
def to_str
|
7
|
+
"foo"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
test "with symbol-keyed hash attributes" do
|
12
|
+
component = build_component_with_template do
|
13
|
+
div data: { name: { first_name: "Joel" } }
|
14
|
+
end
|
15
|
+
|
16
|
+
expect(component.new).to_render %(<div data-name-first-name="Joel"></div>)
|
17
|
+
end
|
18
|
+
|
19
|
+
test "with string-keyed hash attributes" do
|
20
|
+
component = build_component_with_template do
|
21
|
+
div data: { "name" => { "first_name" => "Joel" } }
|
22
|
+
end
|
23
|
+
|
24
|
+
expect(component.new).to_render %(<div data-name-first_name="Joel"></div>)
|
25
|
+
end
|
26
|
+
|
27
|
+
test "with an array of symbols and strings" do
|
28
|
+
component = build_component_with_template do
|
29
|
+
div class: ["bg-red-500", :rounded]
|
30
|
+
end
|
31
|
+
|
32
|
+
expect(component.new).to_render %(<div class="bg-red-500 rounded"></div>)
|
33
|
+
end
|
34
|
+
|
35
|
+
test "with a set of symbols and strings" do
|
36
|
+
component = build_component_with_template do
|
37
|
+
div class: Set.new(["bg-red-500", :rounded])
|
38
|
+
end
|
39
|
+
|
40
|
+
expect(component.new).to_render %(<div class="bg-red-500 rounded"></div>)
|
41
|
+
end
|
42
|
+
|
43
|
+
test "with a to_str-able object" do
|
44
|
+
component = build_component_with_template do
|
45
|
+
div class: ToStrable.new
|
46
|
+
end
|
47
|
+
|
48
|
+
expect(component.new).to_render %(<div class="foo"></div>)
|
49
|
+
end
|
50
|
+
|
51
|
+
test "with numeric integer/float" do
|
52
|
+
component = build_component_with_template do
|
53
|
+
input type: "range", min: 0, max: 10, step: 0.5
|
54
|
+
end
|
55
|
+
|
56
|
+
expect(component.new).to_render %(<input type="range" min="0" max="10" step="0.5">)
|
57
|
+
end
|
58
|
+
|
59
|
+
if RUBY_ENGINE == "ruby"
|
60
|
+
context "with unique tag attributes" do
|
61
|
+
let def component
|
62
|
+
build_component_with_template do
|
63
|
+
div class: SecureRandom.hex
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
let def report
|
68
|
+
component.call
|
69
|
+
|
70
|
+
MemoryProfiler.report do
|
71
|
+
2.times { component.call }
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
test "doesn't leak memory" do
|
76
|
+
expect(report.total_retained) == 0
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "phlex"
|
4
|
+
require "bundler"
|
5
|
+
|
6
|
+
Bundler.require :test
|
7
|
+
|
8
|
+
module TestHelper
|
9
|
+
def build_component_with_template(&block)
|
10
|
+
Class.new(Phlex::HTML) { define_method(:template, &block) }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
module ToRender
|
15
|
+
def to_render(expected_output)
|
16
|
+
output = subject.call
|
17
|
+
assert(output == expected_output) { "Expected `#{output.inspect}` to equal `#{expected_output.inspect}`." }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
GreenDots.configure do |config|
|
22
|
+
config.register_matcher ToRender, Phlex::SGML
|
23
|
+
end
|
data/lib/phlex/context.rb
CHANGED
@@ -4,18 +4,22 @@
|
|
4
4
|
class Phlex::Context
|
5
5
|
def initialize
|
6
6
|
@target = +""
|
7
|
+
@capturing = false
|
7
8
|
end
|
8
9
|
|
9
|
-
attr_accessor :target
|
10
|
+
attr_accessor :target, :capturing
|
10
11
|
|
11
|
-
def
|
12
|
+
def capturing_into(new_target)
|
12
13
|
original_target = @target
|
14
|
+
original_capturing = @capturing
|
13
15
|
|
14
16
|
begin
|
15
17
|
@target = new_target
|
18
|
+
@capturing = true
|
16
19
|
yield
|
17
20
|
ensure
|
18
21
|
@target = original_target
|
22
|
+
@capturing = original_capturing
|
19
23
|
end
|
20
24
|
|
21
25
|
new_target
|
data/lib/phlex/elements.rb
CHANGED
@@ -42,7 +42,7 @@ module Phlex::Elements
|
|
42
42
|
target = @_context.target
|
43
43
|
|
44
44
|
if attributes.length > 0 # with attributes
|
45
|
-
if
|
45
|
+
if block # with content block
|
46
46
|
target << "<#{tag}" << (Phlex::ATTRIBUTE_CACHE[respond_to?(:process_attributes) ? (attributes.hash + self.class.hash) : attributes.hash] || __attributes__(**attributes)) << ">"
|
47
47
|
yield_content(&block)
|
48
48
|
target << "</#{tag}>"
|
@@ -50,7 +50,7 @@ module Phlex::Elements
|
|
50
50
|
target << "<#{tag}" << (Phlex::ATTRIBUTE_CACHE[respond_to?(:process_attributes) ? (attributes.hash + self.class.hash) : attributes.hash] || __attributes__(**attributes)) << "></#{tag}>"
|
51
51
|
end
|
52
52
|
else # without attributes
|
53
|
-
if
|
53
|
+
if block # with content block
|
54
54
|
target << "<#{tag}>"
|
55
55
|
yield_content(&block)
|
56
56
|
target << "</#{tag}>"
|
@@ -81,6 +81,13 @@ module Phlex::HTML::StandardElements
|
|
81
81
|
# @see https://developer.mozilla.org/docs/Web/HTML/Element/button
|
82
82
|
register_element :button, tag: "button"
|
83
83
|
|
84
|
+
# @!method canvas(**attributes, &content)
|
85
|
+
# Outputs a `<canvas>` tag.
|
86
|
+
# @return [nil]
|
87
|
+
# @yieldparam component [self]
|
88
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/canvas
|
89
|
+
register_element :canvas, tag: "canvas"
|
90
|
+
|
84
91
|
# @!method caption(**attributes, &content)
|
85
92
|
# Outputs a `<caption>` tag.
|
86
93
|
# @return [nil]
|
@@ -96,7 +103,7 @@ module Phlex::HTML::StandardElements
|
|
96
103
|
register_element :cite, tag: "cite"
|
97
104
|
|
98
105
|
# @!method code(**attributes, &content)
|
99
|
-
# Outputs a
|
106
|
+
# Outputs a `<code>` tag.
|
100
107
|
# @return [nil]
|
101
108
|
# @yieldparam component [self]
|
102
109
|
# @see https://developer.mozilla.org/docs/Web/HTML/Element/code
|
@@ -278,14 +285,14 @@ module Phlex::HTML::StandardElements
|
|
278
285
|
register_element :header, tag: "header"
|
279
286
|
|
280
287
|
# @!method hgroup(**attributes, &content)
|
281
|
-
# Outputs
|
288
|
+
# Outputs an `<hgroup>` tag.
|
282
289
|
# @return [nil]
|
283
290
|
# @yieldparam component [self]
|
284
291
|
# @see https://developer.mozilla.org/docs/Web/HTML/Element/hgroup
|
285
292
|
register_element :hgroup, tag: "hgroup"
|
286
293
|
|
287
294
|
# @!method html(**attributes, &content)
|
288
|
-
# Outputs
|
295
|
+
# Outputs an `<html>` tag.
|
289
296
|
# @return [nil]
|
290
297
|
# @yieldparam component [self]
|
291
298
|
# @see https://developer.mozilla.org/docs/Web/HTML/Element/html
|
@@ -453,14 +460,14 @@ module Phlex::HTML::StandardElements
|
|
453
460
|
register_element :q, tag: "q"
|
454
461
|
|
455
462
|
# @!method rp(**attributes, &content)
|
456
|
-
# Outputs
|
463
|
+
# Outputs an `<rp>` tag.
|
457
464
|
# @return [nil]
|
458
465
|
# @yieldparam component [self]
|
459
466
|
# @see https://developer.mozilla.org/docs/Web/HTML/Element/rp
|
460
467
|
register_element :rp, tag: "rp"
|
461
468
|
|
462
469
|
# @!method rt(**attributes, &content)
|
463
|
-
# Outputs
|
470
|
+
# Outputs an `<rt>` tag.
|
464
471
|
# @return [nil]
|
465
472
|
# @yieldparam component [self]
|
466
473
|
# @see https://developer.mozilla.org/docs/Web/HTML/Element/rt
|
@@ -474,7 +481,7 @@ module Phlex::HTML::StandardElements
|
|
474
481
|
register_element :ruby, tag: "ruby"
|
475
482
|
|
476
483
|
# @!method s(**attributes, &content)
|
477
|
-
# Outputs
|
484
|
+
# Outputs an `<s>` tag.
|
478
485
|
# @return [nil]
|
479
486
|
# @yieldparam component [self]
|
480
487
|
# @see https://developer.mozilla.org/docs/Web/HTML/Element/s
|
data/lib/phlex/sgml.rb
CHANGED
@@ -182,13 +182,15 @@ module Phlex
|
|
182
182
|
def capture(&block)
|
183
183
|
return "" unless block
|
184
184
|
|
185
|
-
@_context.
|
185
|
+
@_context.capturing_into(+"") { yield_content(&block) }
|
186
186
|
end
|
187
187
|
|
188
188
|
private
|
189
189
|
|
190
190
|
# @api private
|
191
191
|
def flush
|
192
|
+
return if @_context.capturing
|
193
|
+
|
192
194
|
target = @_context.target
|
193
195
|
@_buffer << target.dup
|
194
196
|
target.clear
|
@@ -220,14 +222,16 @@ module Phlex
|
|
220
222
|
end
|
221
223
|
when Enumerable
|
222
224
|
renderable.each { |r| render(r, &block) }
|
223
|
-
when Proc
|
225
|
+
when Proc, Method
|
224
226
|
if renderable.arity == 0
|
225
227
|
yield_content_with_no_args(&renderable)
|
226
228
|
else
|
227
229
|
yield_content(&renderable)
|
228
230
|
end
|
231
|
+
when String
|
232
|
+
plain(renderable)
|
229
233
|
else
|
230
|
-
raise ArgumentError, "You can't render a #{renderable}."
|
234
|
+
raise ArgumentError, "You can't render a #{renderable.inspect}."
|
231
235
|
end
|
232
236
|
|
233
237
|
nil
|
@@ -240,7 +244,7 @@ module Phlex
|
|
240
244
|
def __vanish__(*args)
|
241
245
|
return unless block_given?
|
242
246
|
|
243
|
-
@_context.
|
247
|
+
@_context.capturing_into(BlackHole) { yield(*args) }
|
244
248
|
|
245
249
|
nil
|
246
250
|
end
|
@@ -257,7 +261,7 @@ module Phlex
|
|
257
261
|
# @return [String]
|
258
262
|
def format_object(object)
|
259
263
|
case object
|
260
|
-
when Float
|
264
|
+
when Float, Integer
|
261
265
|
object.to_s
|
262
266
|
end
|
263
267
|
end
|
@@ -336,8 +340,6 @@ module Phlex
|
|
336
340
|
@_context.target << ERB::Escape.html_escape(content)
|
337
341
|
when Symbol
|
338
342
|
@_context.target << ERB::Escape.html_escape(content.name)
|
339
|
-
when Integer
|
340
|
-
@_context.target << content.to_s
|
341
343
|
when nil
|
342
344
|
nil
|
343
345
|
else
|
@@ -364,6 +366,14 @@ module Phlex
|
|
364
366
|
attributes = process_attributes(**attributes)
|
365
367
|
end
|
366
368
|
|
369
|
+
if attributes[:href]&.start_with?(/\s*javascript:/)
|
370
|
+
attributes.delete(:href)
|
371
|
+
end
|
372
|
+
|
373
|
+
if attributes["href"]&.start_with?(/\s*javascript:/)
|
374
|
+
attributes.delete("href")
|
375
|
+
end
|
376
|
+
|
367
377
|
buffer = +""
|
368
378
|
__build_attributes__(attributes, buffer: buffer)
|
369
379
|
|
@@ -381,11 +391,8 @@ module Phlex
|
|
381
391
|
else raise ArgumentError, "Attribute keys should be Strings or Symbols."
|
382
392
|
end
|
383
393
|
|
384
|
-
lower_name = name.downcase
|
385
|
-
next if lower_name == "href" && v.to_s.downcase.tr("\t \n", "").start_with?("javascript:")
|
386
|
-
|
387
394
|
# Detect unsafe attribute names. Attribute names are considered unsafe if they match an event attribute or include unsafe characters.
|
388
|
-
if HTML::EVENT_ATTRIBUTES[
|
395
|
+
if HTML::EVENT_ATTRIBUTES[name] || name.match?(/[<>&"']/)
|
389
396
|
raise ArgumentError, "Unsafe attribute name detected: #{k}."
|
390
397
|
end
|
391
398
|
|
@@ -74,175 +74,175 @@ module Phlex::SVG::StandardElements
|
|
74
74
|
register_element :ellipse, tag: "ellipse"
|
75
75
|
|
76
76
|
# @!method feBlend(**attributes, &content)
|
77
|
-
# Outputs
|
77
|
+
# Outputs an `<feBlend>` tag.
|
78
78
|
# @return [nil]
|
79
79
|
# @yieldparam component [self]
|
80
80
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feBlend
|
81
81
|
register_element :feBlend, tag: "feBlend"
|
82
82
|
|
83
83
|
# @!method feColorMatrix(**attributes, &content)
|
84
|
-
# Outputs
|
84
|
+
# Outputs an `<feColorMatrix>` tag.
|
85
85
|
# @return [nil]
|
86
86
|
# @yieldparam component [self]
|
87
87
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feColorMatrix
|
88
88
|
register_element :feColorMatrix, tag: "feColorMatrix"
|
89
89
|
|
90
90
|
# @!method feComponentTransfer(**attributes, &content)
|
91
|
-
# Outputs
|
91
|
+
# Outputs an `<feComponentTransfer>` tag.
|
92
92
|
# @return [nil]
|
93
93
|
# @yieldparam component [self]
|
94
94
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feComponentTransfer
|
95
95
|
register_element :feComponentTransfer, tag: "feComponentTransfer"
|
96
96
|
|
97
97
|
# @!method feComposite(**attributes, &content)
|
98
|
-
# Outputs
|
98
|
+
# Outputs an `<feComposite>` tag.
|
99
99
|
# @return [nil]
|
100
100
|
# @yieldparam component [self]
|
101
101
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feComposite
|
102
102
|
register_element :feComposite, tag: "feComposite"
|
103
103
|
|
104
104
|
# @!method feConvolveMatrix(**attributes, &content)
|
105
|
-
# Outputs
|
105
|
+
# Outputs an `<feConvolveMatrix>` tag.
|
106
106
|
# @return [nil]
|
107
107
|
# @yieldparam component [self]
|
108
108
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feConvolveMatrix
|
109
109
|
register_element :feConvolveMatrix, tag: "feConvolveMatrix"
|
110
110
|
|
111
111
|
# @!method feDiffuseLighting(**attributes, &content)
|
112
|
-
# Outputs
|
112
|
+
# Outputs an `<feDiffuseLighting>` tag.
|
113
113
|
# @return [nil]
|
114
114
|
# @yieldparam component [self]
|
115
115
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feDiffuseLighting
|
116
116
|
register_element :feDiffuseLighting, tag: "feDiffuseLighting"
|
117
117
|
|
118
118
|
# @!method feDisplacementMap(**attributes, &content)
|
119
|
-
# Outputs
|
119
|
+
# Outputs an `<feDisplacementMap>` tag.
|
120
120
|
# @return [nil]
|
121
121
|
# @yieldparam component [self]
|
122
122
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feDisplacementMap
|
123
123
|
register_element :feDisplacementMap, tag: "feDisplacementMap"
|
124
124
|
|
125
125
|
# @!method feDistantLight(**attributes, &content)
|
126
|
-
# Outputs
|
126
|
+
# Outputs an `<feDistantLight>` tag.
|
127
127
|
# @return [nil]
|
128
128
|
# @yieldparam component [self]
|
129
129
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feDistantLight
|
130
130
|
register_element :feDistantLight, tag: "feDistantLight"
|
131
131
|
|
132
132
|
# @!method feDropShadow(**attributes, &content)
|
133
|
-
# Outputs
|
133
|
+
# Outputs an `<feDropShadow>` tag.
|
134
134
|
# @return [nil]
|
135
135
|
# @yieldparam component [self]
|
136
136
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feDropShadow
|
137
137
|
register_element :feDropShadow, tag: "feDropShadow"
|
138
138
|
|
139
139
|
# @!method feFlood(**attributes, &content)
|
140
|
-
# Outputs
|
140
|
+
# Outputs an `<feFlood>` tag.
|
141
141
|
# @return [nil]
|
142
142
|
# @yieldparam component [self]
|
143
143
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feFlood
|
144
144
|
register_element :feFlood, tag: "feFlood"
|
145
145
|
|
146
146
|
# @!method feFuncA(**attributes, &content)
|
147
|
-
# Outputs
|
147
|
+
# Outputs an `<feFuncA>` tag.
|
148
148
|
# @return [nil]
|
149
149
|
# @yieldparam component [self]
|
150
150
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feFuncA
|
151
151
|
register_element :feFuncA, tag: "feFuncA"
|
152
152
|
|
153
153
|
# @!method feFuncB(**attributes, &content)
|
154
|
-
# Outputs
|
154
|
+
# Outputs an `<feFuncB>` tag.
|
155
155
|
# @return [nil]
|
156
156
|
# @yieldparam component [self]
|
157
157
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feFuncB
|
158
158
|
register_element :feFuncB, tag: "feFuncB"
|
159
159
|
|
160
160
|
# @!method feFuncG(**attributes, &content)
|
161
|
-
# Outputs
|
161
|
+
# Outputs an `<feFuncG>` tag.
|
162
162
|
# @return [nil]
|
163
163
|
# @yieldparam component [self]
|
164
164
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feFuncG
|
165
165
|
register_element :feFuncG, tag: "feFuncG"
|
166
166
|
|
167
167
|
# @!method feFuncR(**attributes, &content)
|
168
|
-
# Outputs
|
168
|
+
# Outputs an `<feFuncR>` tag.
|
169
169
|
# @return [nil]
|
170
170
|
# @yieldparam component [self]
|
171
171
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feFuncR
|
172
172
|
register_element :feFuncR, tag: "feFuncR"
|
173
173
|
|
174
174
|
# @!method feGaussianBlur(**attributes, &content)
|
175
|
-
# Outputs
|
175
|
+
# Outputs an `<feGaussianBlur>` tag.
|
176
176
|
# @return [nil]
|
177
177
|
# @yieldparam component [self]
|
178
178
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feGaussianBlur
|
179
179
|
register_element :feGaussianBlur, tag: "feGaussianBlur"
|
180
180
|
|
181
181
|
# @!method feImage(**attributes, &content)
|
182
|
-
# Outputs
|
182
|
+
# Outputs an `<feImage>` tag.
|
183
183
|
# @return [nil]
|
184
184
|
# @yieldparam component [self]
|
185
185
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feImage
|
186
186
|
register_element :feImage, tag: "feImage"
|
187
187
|
|
188
188
|
# @!method feMerge(**attributes, &content)
|
189
|
-
# Outputs
|
189
|
+
# Outputs an `<feMerge>` tag.
|
190
190
|
# @return [nil]
|
191
191
|
# @yieldparam component [self]
|
192
192
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feMerge
|
193
193
|
register_element :feMerge, tag: "feMerge"
|
194
194
|
|
195
195
|
# @!method feMergeNode(**attributes, &content)
|
196
|
-
# Outputs
|
196
|
+
# Outputs an `<feMergeNode>` tag.
|
197
197
|
# @return [nil]
|
198
198
|
# @yieldparam component [self]
|
199
199
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feMergeNode
|
200
200
|
register_element :feMergeNode, tag: "feMergeNode"
|
201
201
|
|
202
202
|
# @!method feMorphology(**attributes, &content)
|
203
|
-
# Outputs
|
203
|
+
# Outputs an `<feMorphology>` tag.
|
204
204
|
# @return [nil]
|
205
205
|
# @yieldparam component [self]
|
206
206
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feMorphology
|
207
207
|
register_element :feMorphology, tag: "feMorphology"
|
208
208
|
|
209
209
|
# @!method feOffset(**attributes, &content)
|
210
|
-
# Outputs
|
210
|
+
# Outputs an `<feOffset>` tag.
|
211
211
|
# @return [nil]
|
212
212
|
# @yieldparam component [self]
|
213
213
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feOffset
|
214
214
|
register_element :feOffset, tag: "feOffset"
|
215
215
|
|
216
216
|
# @!method fePointLight(**attributes, &content)
|
217
|
-
# Outputs
|
217
|
+
# Outputs an `<fePointLight>` tag.
|
218
218
|
# @return [nil]
|
219
219
|
# @yieldparam component [self]
|
220
220
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/fePointLight
|
221
221
|
register_element :fePointLight, tag: "fePointLight"
|
222
222
|
|
223
223
|
# @!method feSpecularLighting(**attributes, &content)
|
224
|
-
# Outputs
|
224
|
+
# Outputs an `<feSpecularLighting>` tag.
|
225
225
|
# @return [nil]
|
226
226
|
# @yieldparam component [self]
|
227
227
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feSpecularLighting
|
228
228
|
register_element :feSpecularLighting, tag: "feSpecularLighting"
|
229
229
|
|
230
230
|
# @!method feSpotLight(**attributes, &content)
|
231
|
-
# Outputs
|
231
|
+
# Outputs an `<feSpotLight>` tag.
|
232
232
|
# @return [nil]
|
233
233
|
# @yieldparam component [self]
|
234
234
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feSpotLight
|
235
235
|
register_element :feSpotLight, tag: "feSpotLight"
|
236
236
|
|
237
237
|
# @!method feTile(**attributes, &content)
|
238
|
-
# Outputs
|
238
|
+
# Outputs an `<feTile>` tag.
|
239
239
|
# @return [nil]
|
240
240
|
# @yieldparam component [self]
|
241
241
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feTile
|
242
242
|
register_element :feTile, tag: "feTile"
|
243
243
|
|
244
244
|
# @!method feTurbulence(**attributes, &content)
|
245
|
-
# Outputs
|
245
|
+
# Outputs an `<feTurbulence>` tag.
|
246
246
|
# @return [nil]
|
247
247
|
# @yieldparam component [self]
|
248
248
|
# @see https://developer.mozilla.org/docs/Web/SVG/Element/feTurbulence
|
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: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Drapper
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -75,6 +75,9 @@ files:
|
|
75
75
|
- fixtures/layout.rb
|
76
76
|
- fixtures/page.rb
|
77
77
|
- fixtures/view_helper.rb
|
78
|
+
- gd/phlex/callable.rb
|
79
|
+
- gd/phlex/sgml/attributes.rb
|
80
|
+
- gd/support/helper.rb
|
78
81
|
- lib/phlex.rb
|
79
82
|
- lib/phlex/black_hole.rb
|
80
83
|
- lib/phlex/callable.rb
|
@@ -119,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
122
|
- !ruby/object:Gem::Version
|
120
123
|
version: '0'
|
121
124
|
requirements: []
|
122
|
-
rubygems_version: 3.
|
125
|
+
rubygems_version: 3.4.10
|
123
126
|
signing_key:
|
124
127
|
specification_version: 4
|
125
128
|
summary: A fun framework for building views in Ruby.
|