dhtml 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/dhtml/document.rb +3 -9
- data/lib/dhtml/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: 3849846e1ffe735529f10e4c4d6880329df4f2d36c7836ef158ae7e168f415d0
|
4
|
+
data.tar.gz: 2034e0931521ce5040bc1280909a74ec2f306a3e3d2f64d7fc69e029dfeb8b82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb109a1bd183829d6bed1de48b1164b28b423299af49d3ac7f9ae5b6747801d7d9af1daed18e3222051a90b15b534bd8d189fd0ed2dae290cc4b486d6ba3fdb1
|
7
|
+
data.tar.gz: 9010c3138e41151fc13b2f2ab9aee3a893ef89a5a835416d5cbf1daad01ab8a0ee3cafbcb9a9260eb003a623b356dcdd0211bfe9b2b783fba6ee53d4e9bc3ca3
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [0.1.5] - 2021-05-11
|
9
|
+
### Removed
|
10
|
+
- Bytes written is no longer returned since `StringIO` is not fully implemented by Opal.
|
11
|
+
|
8
12
|
## [0.1.4] - 2021-05-11
|
9
13
|
### Added
|
10
14
|
- `pretty_html` method that formats the document in a way presentable to a human.
|
@@ -17,6 +21,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
|
|
17
21
|
- Versions prior to this were yanked. The gems were packaged with absolute paths by mistake.
|
18
22
|
|
19
23
|
[Unreleased]: https://github.com/hi5dev/dhtml/compare/v0.1.4...HEAD
|
24
|
+
[0.1.5]: https://github.com/hi5dev/dhtml/compare/v0.1.4..v0.1.5
|
20
25
|
[0.1.4]: https://github.com/hi5dev/dhtml/compare/v0.1.3..v0.1.4
|
21
26
|
[0.1.3]: https://github.com/hi5dev/dhtml/releases/tag/v0.1.3
|
22
27
|
|
data/Gemfile.lock
CHANGED
data/lib/dhtml/document.rb
CHANGED
@@ -130,17 +130,15 @@ module DHTML
|
|
130
130
|
#
|
131
131
|
# @!attribute [String] tag
|
132
132
|
# @!attribute [Hash] attributes
|
133
|
-
# @return [
|
133
|
+
# @return [void]
|
134
134
|
# @since 0.1.0
|
135
135
|
def write_html_element(tag, attributes = {})
|
136
|
-
length = document.length
|
137
|
-
|
138
136
|
document << '<'
|
139
137
|
document << tag
|
140
138
|
document << " #{html_attributes(attributes)}" unless attributes.empty?
|
141
139
|
document << '>'
|
142
140
|
|
143
|
-
|
141
|
+
nil
|
144
142
|
end
|
145
143
|
|
146
144
|
# Write a tag to the HTML document.
|
@@ -158,9 +156,6 @@ module DHTML
|
|
158
156
|
tag = tag.to_s
|
159
157
|
tag = tag[1..-1] if tag[0] == '_'
|
160
158
|
|
161
|
-
# Used to calculate the number of bytes written for the return value.
|
162
|
-
length = document.length
|
163
|
-
|
164
159
|
# Opening tag with its HTML attributes - e.g. <div id="main">
|
165
160
|
write_html_element(tag, attributes)
|
166
161
|
|
@@ -173,8 +168,7 @@ module DHTML
|
|
173
168
|
# Close the tag when necessary.
|
174
169
|
document.write("</#{tag}>") if content.is_a?(String) || block_given? || !void?(tag.to_sym)
|
175
170
|
|
176
|
-
|
177
|
-
document.length - length
|
171
|
+
nil
|
178
172
|
end
|
179
173
|
end
|
180
174
|
end
|
data/lib/dhtml/version.rb
CHANGED