hyalite 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/hyalite/component.rb +2 -1
- data/lib/hyalite/element.rb +1 -0
- data/lib/hyalite/main.rb +11 -3
- data/lib/hyalite/version.rb +1 -1
- metadata +3 -4
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 97d81068c80477baf4128d88b35389a3d9f25a77cf5bc5f506340fa4472bc8f8
|
4
|
+
data.tar.gz: e1eccec6dfc4d0a0672418fe54870d8b1a4916b0880297c648009173b026e36e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa63333c172b11a3f7f2fa23f4d849437cd1aa26cf7079173f288db8e90af71eee84d699e1669d4d46ab7cfce2c8fc844093c3c92dea5ccf7d220deb0aea9e22
|
7
|
+
data.tar.gz: 2db3e64bb316f2f05f394f1d53dd7f6c771a3209758eb30a9e0306e9a53262acfd50e563a4bee853d03f9039c3462d5f4c211d7d9a140080610a1dc8b20925f7
|
data/lib/hyalite/component.rb
CHANGED
@@ -87,9 +87,10 @@ module Hyalite
|
|
87
87
|
Hyalite.create_element_hook do |hook_setter|
|
88
88
|
renderer = ChildrenRenderer.new(self, hook_setter)
|
89
89
|
renderer.instance_eval(&block)
|
90
|
-
children
|
90
|
+
children += renderer.children.select{|el| el.is_a?(ElementObject) && el.parent.nil? }
|
91
91
|
end
|
92
92
|
end
|
93
|
+
|
93
94
|
Hyalite.create_element(tag, props, *children)
|
94
95
|
end
|
95
96
|
end
|
data/lib/hyalite/element.rb
CHANGED
data/lib/hyalite/main.rb
CHANGED
@@ -18,7 +18,12 @@ module Hyalite
|
|
18
18
|
|
19
19
|
props = {}
|
20
20
|
|
21
|
-
|
21
|
+
case config
|
22
|
+
when String
|
23
|
+
children = [config]
|
24
|
+
when Array
|
25
|
+
children = config
|
26
|
+
when Hash
|
22
27
|
key = config[:key]
|
23
28
|
ref = config[:ref]
|
24
29
|
|
@@ -38,7 +43,10 @@ module Hyalite
|
|
38
43
|
children
|
39
44
|
end
|
40
45
|
|
41
|
-
ElementObject.new(type, key, ref, Hyalite.current_owner, props).tap
|
46
|
+
ElementObject.new(type, key, ref, Hyalite.current_owner, props).tap do |el|
|
47
|
+
children.each {|child| child.parent = el if child.is_a?(ElementObject) }
|
48
|
+
element_created(el)
|
49
|
+
end
|
42
50
|
end
|
43
51
|
|
44
52
|
def element_created(element)
|
@@ -48,7 +56,7 @@ module Hyalite
|
|
48
56
|
end
|
49
57
|
end
|
50
58
|
|
51
|
-
def create_element_hook(&block)
|
59
|
+
def create_element_hook(key, &block)
|
52
60
|
@hooks ||= []
|
53
61
|
hook_setter = HookSetter.new(@hooks)
|
54
62
|
yield hook_setter
|
data/lib/hyalite/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyalite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- youchan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -60,7 +60,6 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
|
-
- ".ruby-version"
|
64
63
|
- ".travis.yml"
|
65
64
|
- Gemfile
|
66
65
|
- Gemfile.lock
|
@@ -145,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
144
|
version: '0'
|
146
145
|
requirements: []
|
147
146
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.
|
147
|
+
rubygems_version: 2.7.3
|
149
148
|
signing_key:
|
150
149
|
specification_version: 4
|
151
150
|
summary: Virtual DOM implimentation in Ruby
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.3.3
|