hot_module 1.0.0.alpha2 → 1.0.0.alpha3
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/Gemfile.lock +25 -24
- data/hot_module.gemspec +1 -1
- data/lib/hot_module/petite.rb +1 -1
- data/lib/hot_module/query_selection.rb +1 -2
- data/lib/hot_module/version.rb +1 -1
- data/lib/hot_module.rb +2 -25
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc20758effe540a0a4bbb8627fcdd7b3cf528792795de33dd039542e495ad8f9
|
|
4
|
+
data.tar.gz: e6dd965829f44ec8402c8c3a8664ac6c63a203050c945bba89eec02081629e48
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1600644deca41a43f7e9fdd3a33b880d20867cedbcc3251d025c3d0db9c0a0e63239328f46a57ad23a7e71de1793c5c987acb815023fb7496481dadca65d597f
|
|
7
|
+
data.tar.gz: 8901f9bfccaadbde5655bc5b60b5a03120ad422b8fb664b8305a1b4fe2489453608953bdc67f57a85a6125e55e25811af451e11440cdf873a48f89f905939296
|
data/Gemfile.lock
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
hot_module (1.0.0.
|
|
5
|
-
nokolexbor (~> 0.
|
|
4
|
+
hot_module (1.0.0.alpha3)
|
|
5
|
+
nokolexbor (~> 0.4)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activesupport (7.0.4)
|
|
10
|
+
activesupport (7.0.4.3)
|
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
12
12
|
i18n (>= 1.6, < 2)
|
|
13
13
|
minitest (>= 5.1)
|
|
14
14
|
tzinfo (~> 2.0)
|
|
15
15
|
ast (2.4.2)
|
|
16
16
|
backport (1.2.0)
|
|
17
|
-
benchmark (0.2.
|
|
18
|
-
concurrent-ruby (1.
|
|
17
|
+
benchmark (0.2.1)
|
|
18
|
+
concurrent-ruby (1.2.2)
|
|
19
19
|
diff-lcs (1.5.0)
|
|
20
20
|
e2mmap (0.1.0)
|
|
21
21
|
hash_with_dot_access (1.2.0)
|
|
@@ -23,44 +23,45 @@ GEM
|
|
|
23
23
|
i18n (1.12.0)
|
|
24
24
|
concurrent-ruby (~> 1.0)
|
|
25
25
|
jaro_winkler (1.5.4)
|
|
26
|
-
json (2.6.
|
|
26
|
+
json (2.6.3)
|
|
27
27
|
kramdown (2.4.0)
|
|
28
28
|
rexml
|
|
29
29
|
kramdown-parser-gfm (1.1.0)
|
|
30
30
|
kramdown (~> 2.0)
|
|
31
|
-
minitest (5.
|
|
32
|
-
nokogiri (1.
|
|
31
|
+
minitest (5.18.0)
|
|
32
|
+
nokogiri (1.14.2-arm64-darwin)
|
|
33
33
|
racc (~> 1.4)
|
|
34
|
-
nokogiri (1.
|
|
34
|
+
nokogiri (1.14.2-x86_64-linux)
|
|
35
35
|
racc (~> 1.4)
|
|
36
|
-
nokolexbor (0.
|
|
36
|
+
nokolexbor (0.4.0-arm64-darwin)
|
|
37
|
+
nokolexbor (0.4.0-x86_64-linux)
|
|
37
38
|
parallel (1.22.1)
|
|
38
|
-
parser (3.
|
|
39
|
+
parser (3.2.1.1)
|
|
39
40
|
ast (~> 2.4.1)
|
|
40
|
-
racc (1.6.
|
|
41
|
+
racc (1.6.2)
|
|
41
42
|
rainbow (3.1.1)
|
|
42
43
|
rake (13.0.6)
|
|
43
|
-
regexp_parser (2.
|
|
44
|
+
regexp_parser (2.7.0)
|
|
44
45
|
reverse_markdown (2.1.1)
|
|
45
46
|
nokogiri
|
|
46
47
|
rexml (3.2.5)
|
|
47
|
-
rubocop (1.
|
|
48
|
+
rubocop (1.48.1)
|
|
48
49
|
json (~> 2.3)
|
|
49
50
|
parallel (~> 1.10)
|
|
50
|
-
parser (>= 3.
|
|
51
|
+
parser (>= 3.2.0.0)
|
|
51
52
|
rainbow (>= 2.2.2, < 4.0)
|
|
52
53
|
regexp_parser (>= 1.8, < 3.0)
|
|
53
54
|
rexml (>= 3.2.5, < 4.0)
|
|
54
|
-
rubocop-ast (>= 1.
|
|
55
|
+
rubocop-ast (>= 1.26.0, < 2.0)
|
|
55
56
|
ruby-progressbar (~> 1.7)
|
|
56
|
-
unicode-display_width (>=
|
|
57
|
-
rubocop-ast (1.
|
|
58
|
-
parser (>= 3.
|
|
59
|
-
rubocop-minitest (0.22.
|
|
57
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
|
58
|
+
rubocop-ast (1.27.0)
|
|
59
|
+
parser (>= 3.2.1.0)
|
|
60
|
+
rubocop-minitest (0.22.2)
|
|
60
61
|
rubocop (>= 0.90, < 2.0)
|
|
61
62
|
rubocop-rake (0.6.0)
|
|
62
63
|
rubocop (~> 1.0)
|
|
63
|
-
ruby-progressbar (1.
|
|
64
|
+
ruby-progressbar (1.13.0)
|
|
64
65
|
solargraph (0.47.2)
|
|
65
66
|
backport (~> 1.2)
|
|
66
67
|
benchmark
|
|
@@ -77,10 +78,10 @@ GEM
|
|
|
77
78
|
tilt (~> 2.0)
|
|
78
79
|
yard (~> 0.9, >= 0.9.24)
|
|
79
80
|
thor (1.2.1)
|
|
80
|
-
tilt (2.0
|
|
81
|
-
tzinfo (2.0.
|
|
81
|
+
tilt (2.1.0)
|
|
82
|
+
tzinfo (2.0.6)
|
|
82
83
|
concurrent-ruby (~> 1.0)
|
|
83
|
-
unicode-display_width (2.
|
|
84
|
+
unicode-display_width (2.4.2)
|
|
84
85
|
webrick (1.7.0)
|
|
85
86
|
yard (0.9.28)
|
|
86
87
|
webrick (~> 1.7.0)
|
data/hot_module.gemspec
CHANGED
data/lib/hot_module/petite.rb
CHANGED
|
@@ -12,6 +12,5 @@ module HoTModuLe
|
|
|
12
12
|
def query_selector_all(selector) = css(selector)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
# Nokogiri::XML::Node.include QuerySelection unless Nokogiri::XML::Node.instance_methods.include?(:query_selector)
|
|
15
|
+
Nokolexbor::Element.include QuerySelection unless Nokolexbor::Element.instance_methods.include?(:query_selector)
|
|
17
16
|
end
|
data/lib/hot_module/version.rb
CHANGED
data/lib/hot_module.rb
CHANGED
|
@@ -21,7 +21,7 @@ module HoTModuLe
|
|
|
21
21
|
AttributeBinding = Struct.new(:matcher, :method_name, :method, :only_for_tag, keyword_init: true) # rubocop:disable Lint/StructNewOverride
|
|
22
22
|
|
|
23
23
|
require_relative "hot_module/fragment"
|
|
24
|
-
|
|
24
|
+
require_relative "hot_module/query_selection"
|
|
25
25
|
|
|
26
26
|
# @param klass [Class]
|
|
27
27
|
# @return [void]
|
|
@@ -92,7 +92,7 @@ module HoTModuLe
|
|
|
92
92
|
def doc
|
|
93
93
|
@doc ||= Nokolexbor::DocumentFragment.parse(
|
|
94
94
|
"<#{tag_name}>#{File.read(html_module).strip}</#{tag_name}>"
|
|
95
|
-
).
|
|
95
|
+
).element_children.first
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
def attribute_bindings
|
|
@@ -126,17 +126,6 @@ module HoTModuLe
|
|
|
126
126
|
def render_element(attributes: self.attributes, content: self.content, return_node: false) # rubocop:disable Metrics
|
|
127
127
|
doc = self.class.doc.clone
|
|
128
128
|
|
|
129
|
-
# NOTE: have to fix cloned templates
|
|
130
|
-
doc.css("template").each do |bad_tmpl|
|
|
131
|
-
frag = bad_tmpl.children.last
|
|
132
|
-
new_tmpl = doc.document.create_element("template")
|
|
133
|
-
bad_tmpl.attributes.each do |k, v|
|
|
134
|
-
new_tmpl[k] = v
|
|
135
|
-
end
|
|
136
|
-
new_tmpl.children[0].children = frag
|
|
137
|
-
bad_tmpl.swap(new_tmpl)
|
|
138
|
-
end
|
|
139
|
-
|
|
140
129
|
tmpl_el = doc.css("> template").find { _1.attributes.length.zero? }
|
|
141
130
|
|
|
142
131
|
unless tmpl_el
|
|
@@ -249,18 +238,6 @@ module HoTModuLe
|
|
|
249
238
|
_in_context_nodes do |previous_context|
|
|
250
239
|
list_items.each_with_index do |list_item, index|
|
|
251
240
|
new_node = item_node.clone
|
|
252
|
-
|
|
253
|
-
# NOTE: have to fix cloned templates
|
|
254
|
-
new_node.css("template").each do |bad_tmpl|
|
|
255
|
-
frag = bad_tmpl.children.last
|
|
256
|
-
new_tmpl = item_node.document.create_element("template")
|
|
257
|
-
bad_tmpl.attributes.each do |k, v|
|
|
258
|
-
new_tmpl[k] = v
|
|
259
|
-
end
|
|
260
|
-
new_tmpl.children[0].children = frag
|
|
261
|
-
bad_tmpl.swap(new_tmpl)
|
|
262
|
-
end
|
|
263
|
-
|
|
264
241
|
node.parent << new_node
|
|
265
242
|
new_node["hmod-added"] = ""
|
|
266
243
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hot_module
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.0.
|
|
4
|
+
version: 1.0.0.alpha3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jared White
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-03-
|
|
11
|
+
date: 2023-03-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokolexbor
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0.
|
|
19
|
+
version: '0.4'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0.
|
|
26
|
+
version: '0.4'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: hash_with_dot_access
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|