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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09727302c479923a2ba6cb0d528876dc33ce7094abf4bcf1b966d15dbff40833'
4
- data.tar.gz: 6fd16fa00842f46565ae71c02dea9fa1a9424d224b86bb1128e0dcbda7659b11
3
+ metadata.gz: 0b68a563745c2782c8fa9f864f1d00994d6f5b3b1ffb92d651a52875386587fb
4
+ data.tar.gz: 4e272a581c83f91a4ba0e0a382bb2f54f3c7b3918e88b6c232d503f407046e75
5
5
  SHA512:
6
- metadata.gz: e0c97c92e8343429f0965a4edd34b49e3199eba4d665ce805961f9d8e2e63d0f9e5c313629cffbeab47d1fea0e9fe1fe8f3c95d48ceaf82b8b963e1bca70c014
7
- data.tar.gz: 2c00865b16a83bfe181b22e99c96142825d777095b4bbbb0983a10ab3c1aebfef75c00e0045633dc6e449bdca3f7883606975626cf350f3a19d7a687b851321a
6
+ metadata.gz: 4db12efca6e80561f266b3118a401bb81c2859a5b6b4f3f6db301ea711c468b1ad426a59db9dc0e9ea02056e60e7c325223051dd2e4a2309dc14d1ffc45410ac
7
+ data.tar.gz: 7c6fe13e7fa6e88d4c1857d4746faae3b622586823cfe6e64a71706efa9aca7ed1e82c9c13f5916f1c6780ab914d6a3576d4cd8571df0df249767bbf0c3b86de
data/.rubocop.yml CHANGED
@@ -6,4 +6,10 @@ AllCops:
6
6
  TargetRubyVersion: 2.7
7
7
 
8
8
  Style/ExplicitBlockArgument:
9
- Enabled: false
9
+ Enabled: false
10
+
11
+ Style/MixinUsage:
12
+ Enabled: false
13
+
14
+ Style/RedundantDoubleSplatHashBraces:
15
+ Enabled: false
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.8.1] 2024-04-19
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] 2024-04-19
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] 2024-04-18
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
- We use the **[Sus](https://github.com/ioquatix/sus)** testing framework. It feels a bit like RSpec with a few small differences. There’s no documentation for Sus at the moment, but you should be able to pick up the basics from reading other tests or looking at the implementation in the Sus repo.
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
- You can run all the tests with `bundle exec sus`.
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
@@ -9,6 +9,7 @@ gem "rubocop"
9
9
  gem "sus"
10
10
  gem "benchmark-ips"
11
11
  gem "yard"
12
+ gem "green_dots", github: "joeldrapper/green_dots"
12
13
 
13
14
  group :test do
14
15
  gem "i18n"
@@ -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 with_target(new_target)
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
@@ -42,7 +42,7 @@ module Phlex::Elements
42
42
  target = @_context.target
43
43
 
44
44
  if attributes.length > 0 # with attributes
45
- if block_given? # with content block
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 block_given? # with content block
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 ``` tag.
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 a `<hgroup>` tag.
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 a `<html>` tag.
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 a `<rp>` tag.
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 a `<rt>` tag.
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 a `<s>` tag.
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.with_target(+"") { yield_content(&block) }
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.with_target(BlackHole) { yield(*args) }
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[lower_name] || name.match?(/[<>&"']/)
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 a `<feBlend>` tag.
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 a `<feColorMatrix>` tag.
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 a `<feComponentTransfer>` tag.
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 a `<feComposite>` tag.
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 a `<feConvolveMatrix>` tag.
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 a `<feDiffuseLighting>` tag.
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 a `<feDisplacementMap>` tag.
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 a `<feDistantLight>` tag.
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 a `<feDropShadow>` tag.
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 a `<feFlood>` tag.
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 a `<feFuncA>` tag.
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 a `<feFuncB>` tag.
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 a `<feFuncG>` tag.
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 a `<feFuncR>` tag.
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 a `<feGaussianBlur>` tag.
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 a `<feImage>` tag.
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 a `<feMerge>` tag.
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 a `<feMergeNode>` tag.
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 a `<feMorphology>` tag.
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 a `<feOffset>` tag.
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 a `<fePointLight>` tag.
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 a `<feSpecularLighting>` tag.
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 a `<feSpotLight>` tag.
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 a `<feTile>` tag.
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 a `<feTurbulence>` tag.
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Phlex
4
- VERSION = "1.8.3"
4
+ VERSION = "1.9.0"
5
5
  end
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.8.3
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: 2024-04-17 00:00:00.000000000 Z
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.5.9
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.