json_flit 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/demo/Gemfile.lock +3 -3
- data/demo/app/controllers/welcome_controller.rb +1 -1
- data/lib/json_flit/builder.rb +3 -13
- data/lib/json_flit/factory/align.rb +6 -0
- data/lib/json_flit/factory/app_bar.rb +6 -0
- data/lib/json_flit/factory/scaffold.rb +9 -3
- data/lib/json_flit/factory/stack.rb +6 -0
- data/lib/json_flit/version.rb +1 -1
- data/lib/json_flit.rb +1 -0
- 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: 6f247d3ee90e1d34dcaa86d5b4d85897f68183818dcc9c2a33d67f64839eb2a4
|
4
|
+
data.tar.gz: af0cde9d821362eb4f76af57f7f40e8b65d9c4bb7f47628b49c08dd416f784df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dde17f78b6f0d509926a5a1821b65fa5ce104683840faab9a58f5228e75c49885478fdd4d6fa1150faa4aefc9ba1bfa9298b70bd63cd4852def6a238cb6427dc
|
7
|
+
data.tar.gz: bc7e2be78c08d7cf8e18627fd4e9c57c5a7e6df0e6e205cf1426000e42679aa3c154bbeadeb1ffa49e558c1ea9a36a2c365bc56516729f747874a80e3562de4c
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/afstanton/flit_view_components.git
|
3
|
-
revision:
|
3
|
+
revision: 533df306b6e848e350ee99463726e8c9f1ed19b8
|
4
4
|
branch: main
|
5
5
|
specs:
|
6
|
-
flit_view_components (0.0.
|
6
|
+
flit_view_components (0.0.3)
|
7
7
|
view_component (~> 3.0.0rc3)
|
8
8
|
|
9
9
|
PATH
|
10
10
|
remote: .
|
11
11
|
specs:
|
12
|
-
json_flit (0.0.
|
12
|
+
json_flit (0.0.5)
|
13
13
|
flit_view_components
|
14
14
|
|
15
15
|
GEM
|
data/demo/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/afstanton/flit_view_components.git
|
3
|
-
revision:
|
3
|
+
revision: 533df306b6e848e350ee99463726e8c9f1ed19b8
|
4
4
|
branch: main
|
5
5
|
specs:
|
6
|
-
flit_view_components (0.0.
|
6
|
+
flit_view_components (0.0.3)
|
7
7
|
view_component (~> 3.0.0rc3)
|
8
8
|
|
9
9
|
PATH
|
10
10
|
remote: ..
|
11
11
|
specs:
|
12
|
-
json_flit (0.0.
|
12
|
+
json_flit (0.0.4)
|
13
13
|
flit_view_components
|
14
14
|
|
15
15
|
GEM
|
data/lib/json_flit/builder.rb
CHANGED
@@ -6,21 +6,11 @@ module JsonFlit
|
|
6
6
|
@data = data
|
7
7
|
end
|
8
8
|
|
9
|
-
def build
|
10
|
-
builder = @registry.component(layout['type'])
|
11
|
-
component = builder.new(data: @data).build
|
12
|
-
if layout['children']
|
13
|
-
layout['children'].each do |child|
|
14
|
-
component.children << build(layout: child)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
if layout['child']
|
19
|
-
component.child = build(layout: layout['child'])
|
20
|
-
end
|
9
|
+
def build
|
10
|
+
builder = @registry.component(@layout['type'])
|
11
|
+
component = builder.new(registry: @registry, layout: @layout, data: @data).build
|
21
12
|
|
22
13
|
component
|
23
14
|
end
|
24
|
-
|
25
15
|
end
|
26
16
|
end
|
@@ -1,12 +1,18 @@
|
|
1
1
|
module JsonFlit
|
2
2
|
module Factory
|
3
3
|
class Scaffold
|
4
|
-
def initialize(data:)
|
5
|
-
|
4
|
+
def initialize(registry:, layout:, data:)
|
5
|
+
args = layout['args']
|
6
|
+
|
7
|
+
@app_bar = JsonFlit::Builder.new(registry: registry, layout: args['appBar'], data: data)
|
8
|
+
@body = JsonFlit::Builder.new(registry: registry, layout: args['body'], data: data)
|
6
9
|
end
|
7
10
|
|
8
11
|
def build
|
9
|
-
Flit::ScaffoldComponent.new(
|
12
|
+
Flit::ScaffoldComponent.new(
|
13
|
+
app_bar: @app_bar.build,
|
14
|
+
body: @body.build
|
15
|
+
)
|
10
16
|
end
|
11
17
|
end
|
12
18
|
end
|
data/lib/json_flit/version.rb
CHANGED
data/lib/json_flit.rb
CHANGED