phlex 1.0.1 → 1.1.1
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/README.md +17 -0
- data/lib/phlex/html.rb +14 -6
- data/lib/phlex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e06bb8d47be22009079c466771304f5e8cd413be8de6e3fb57eb0b64cc84037
|
4
|
+
data.tar.gz: 45a39c4ea77541549ce3e913875a3400c5abf247c5f9c72fa4d9002b7ea1186c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb771c7f3ff0d11e513f3c7e70d6783dc7a7f40b19611f961c56b39ef22412479a55333d5a3432ee5564a8f102377122f4a43529a107adffbc82da17dfc4bdc0
|
7
|
+
data.tar.gz: 8e2671c58f64d9da93581e2c5bdab188eea8f5f468d0327ae50a264d7c3297c8f8dbeadae0c59f8cce05e2f3446d178ce8d2c0a18eb82bf5e922ded811a1fd2b
|
data/README.md
CHANGED
@@ -14,6 +14,12 @@ If you run into any trouble, please [start a discussion](https://github.com/joel
|
|
14
14
|
|
15
15
|
Everyone interacting in Phlex codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/joeldrapper/phlex/blob/main/CODE_OF_CONDUCT.md).
|
16
16
|
|
17
|
+
### Who uses Phlex?
|
18
|
+
|
19
|
+
- [Clearscope](https://www.clearscope.io)
|
20
|
+
|
21
|
+
*If you can share that your company uses Phlex in production, please open a PR to list it here.*
|
22
|
+
|
17
23
|
### Sponsorship 💖
|
18
24
|
|
19
25
|
Maintaining a library is a lot of work. If your company benefits from this work or is likely to benefit from it in the future, please consider [sponsorship](https://github.com/sponsors/joeldrapper). Phlex is actively developed and maintained by **[Joel Drapper](https://github.com/sponsors/joeldrapper)**.
|
@@ -25,3 +31,14 @@ If you’ve found a potential security issue, please email [security@phlex.fun](
|
|
25
31
|
### Thanks 🙏
|
26
32
|
|
27
33
|
Thanks [Logology](https://www.logology.co) for sponsoring our logo.
|
34
|
+
|
35
|
+
### Prior Art 🎨
|
36
|
+
|
37
|
+
- [markaby](https://github.com/markaby/markaby)
|
38
|
+
- [erector](https://github.com/erector/erector)
|
39
|
+
- [papercraft](https://github.com/digital-fabric/papercraft)
|
40
|
+
- [matestack](https://github.com/matestack/matestack-ui-core)
|
41
|
+
- [arbre](https://github.com/activeadmin/arbre)
|
42
|
+
- [tubby](https://github.com/judofyr/tubby)
|
43
|
+
- [hoshi](https://github.com/pete/hoshi)
|
44
|
+
- [hyperstack](https://github.com/hyperstack-org/hyperstack)
|
data/lib/phlex/html.rb
CHANGED
@@ -134,12 +134,12 @@ module Phlex
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def call(buffer = +"", view_context: nil, parent: nil, &block)
|
137
|
-
return buffer unless render?
|
138
|
-
|
139
137
|
@_target = buffer
|
140
138
|
@_view_context = view_context
|
141
139
|
@_parent = parent
|
142
140
|
|
141
|
+
return buffer unless render?
|
142
|
+
|
143
143
|
around_template do
|
144
144
|
if block_given?
|
145
145
|
template do |*args|
|
@@ -154,7 +154,7 @@ module Phlex
|
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
157
|
-
self.class.rendered_at_least_once
|
157
|
+
self.class.rendered_at_least_once = true
|
158
158
|
|
159
159
|
buffer
|
160
160
|
end
|
@@ -224,8 +224,9 @@ module Phlex
|
|
224
224
|
end
|
225
225
|
|
226
226
|
def unsafe_raw(content = nil, &block)
|
227
|
-
|
228
|
-
|
227
|
+
return nil unless content
|
228
|
+
|
229
|
+
@_target << content
|
229
230
|
end
|
230
231
|
|
231
232
|
def capture(&block)
|
@@ -352,7 +353,14 @@ module Phlex
|
|
352
353
|
when Symbol
|
353
354
|
buffer << " " << name << '="' << ERB::Util.html_escape(v.name) << '"'
|
354
355
|
when Hash
|
355
|
-
_build_attributes(
|
356
|
+
_build_attributes(
|
357
|
+
v.transform_keys { |subkey|
|
358
|
+
case subkey
|
359
|
+
when Symbol then"#{k}-#{subkey.name.tr('_', '-')}"
|
360
|
+
else "#{k}-#{subkey}"
|
361
|
+
end
|
362
|
+
}, buffer: buffer
|
363
|
+
)
|
356
364
|
else
|
357
365
|
buffer << " " << name << '="' << ERB::Util.html_escape(v.to_s) << '"'
|
358
366
|
end
|
data/lib/phlex/version.rb
CHANGED