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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b21165a86ac304a46f2d41ba367f3dbc9f7d454f81582cce7fdd197ede5e02c7
4
- data.tar.gz: 852c6cf5e1de9b920e4bf8172ef1f09227aa9bb3f4031963ab91771949646b7a
3
+ metadata.gz: 6f247d3ee90e1d34dcaa86d5b4d85897f68183818dcc9c2a33d67f64839eb2a4
4
+ data.tar.gz: af0cde9d821362eb4f76af57f7f40e8b65d9c4bb7f47628b49c08dd416f784df
5
5
  SHA512:
6
- metadata.gz: 69484a418ac02f47cff1002ee3ef2dd6aad8a0c39e99acb8444a989aece834d40ac3012ef328513429847bb781a544fbfb1aab0a12ec15aaf34fe9f52519d8e7
7
- data.tar.gz: 3749a94c61893a936bcebb7bf65c1dbb5f57571697432a795cd50f74bb91971b3fe83becb47f89c9c9263d96722c08945eea724be86c214ee43be4992125ba4b
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: 739dbf1c71fcf3cd31681628be1baf2b20f68e91
3
+ revision: 533df306b6e848e350ee99463726e8c9f1ed19b8
4
4
  branch: main
5
5
  specs:
6
- flit_view_components (0.0.2)
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.4)
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: 739dbf1c71fcf3cd31681628be1baf2b20f68e91
3
+ revision: 533df306b6e848e350ee99463726e8c9f1ed19b8
4
4
  branch: main
5
5
  specs:
6
- flit_view_components (0.0.2)
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.3)
12
+ json_flit (0.0.4)
13
13
  flit_view_components
14
14
 
15
15
  GEM
@@ -20,7 +20,7 @@ class WelcomeController < ApplicationController
20
20
 
21
21
  registry = JsonFlit::Registry.new
22
22
  builder = JsonFlit::Builder.new(registry: registry, layout: @layout, data: @data)
23
- @component = builder.build
24
23
 
24
+ @component = builder.build
25
25
  end
26
26
  end
@@ -6,21 +6,11 @@ module JsonFlit
6
6
  @data = data
7
7
  end
8
8
 
9
- def build(layout: @layout)
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,7 +1,13 @@
1
1
  module JsonFlit
2
2
  module Factory
3
3
  class Align
4
+ def initialize(registry:, layout:, data:)
4
5
 
6
+ end
7
+
8
+ def build
9
+ Flit::AlignComponent.new
10
+ end
5
11
  end
6
12
  end
7
13
  end
@@ -1,7 +1,13 @@
1
1
  module JsonFlit
2
2
  module Factory
3
3
  class AppBar
4
+ def initialize(registry:, layout:, data:)
4
5
 
6
+ end
7
+
8
+ def build
9
+ Flit::AppBarComponent.new
10
+ end
5
11
  end
6
12
  end
7
13
  end
@@ -1,12 +1,18 @@
1
1
  module JsonFlit
2
2
  module Factory
3
3
  class Scaffold
4
- def initialize(data:)
5
- @data = data
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(@data)
12
+ Flit::ScaffoldComponent.new(
13
+ app_bar: @app_bar.build,
14
+ body: @body.build
15
+ )
10
16
  end
11
17
  end
12
18
  end
@@ -1,6 +1,12 @@
1
1
  module JsonFlit
2
2
  module Factory
3
3
  class Stack
4
+ def initialize(registry:, layout:, data:)
5
+ end
6
+
7
+ def build
8
+ Flit::StackComponent.new
9
+ end
4
10
 
5
11
  end
6
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonFlit
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
data/lib/json_flit.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require_relative "json_flit/version"
4
4
  require_relative "json_flit/registry"
5
5
  require_relative "json_flit/builder"
6
+ require_relative "json_flit/factory/base"
6
7
  Dir["#{File.dirname(__FILE__)}/json_flit/factory/**/*.rb"].each { |f| require f }
7
8
 
8
9
  module JsonFlit
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_flit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron F Stanton