ruflet 0.0.7 → 0.0.9

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.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/bin/ruflet +6 -0
  3. data/lib/ruflet/cli/build_command.rb +372 -0
  4. data/lib/ruflet/cli/extra_command.rb +146 -0
  5. data/lib/ruflet/cli/flutter_sdk.rb +359 -0
  6. data/lib/ruflet/cli/new_command.rb +221 -0
  7. data/lib/ruflet/cli/run_command.rb +699 -0
  8. data/lib/ruflet/cli/templates.rb +68 -0
  9. data/lib/ruflet/cli/update_command.rb +111 -0
  10. data/lib/ruflet/cli.rb +85 -0
  11. data/lib/ruflet/version.rb +1 -1
  12. data/lib/ruflet_cli.rb +3 -0
  13. metadata +59 -75
  14. data/lib/ruflet/manifest_compiler.rb +0 -62
  15. data/lib/ruflet.rb +0 -40
  16. data/lib/ruflet_protocol/ruflet/protocol.rb +0 -62
  17. data/lib/ruflet_protocol.rb +0 -4
  18. data/lib/ruflet_ui/ruflet/app.rb +0 -31
  19. data/lib/ruflet_ui/ruflet/colors.rb +0 -234
  20. data/lib/ruflet_ui/ruflet/control.rb +0 -168
  21. data/lib/ruflet_ui/ruflet/dsl.rb +0 -227
  22. data/lib/ruflet_ui/ruflet/event.rb +0 -28
  23. data/lib/ruflet_ui/ruflet/icon_data.rb +0 -62
  24. data/lib/ruflet_ui/ruflet/icons/cupertino/cupertino_icons.rb +0 -54
  25. data/lib/ruflet_ui/ruflet/icons/cupertino_icon_lookup.rb +0 -112
  26. data/lib/ruflet_ui/ruflet/icons/material_icon_lookup.rb +0 -112
  27. data/lib/ruflet_ui/ruflet/icons/material_icons.rb +0 -55
  28. data/lib/ruflet_ui/ruflet/page.rb +0 -741
  29. data/lib/ruflet_ui/ruflet/ui/control_factory.rb +0 -23
  30. data/lib/ruflet_ui/ruflet/ui/control_methods.rb +0 -16
  31. data/lib/ruflet_ui/ruflet/ui/control_registry.rb +0 -13
  32. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_action_sheet_control.rb +0 -13
  33. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_alert_dialog_control.rb +0 -13
  34. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_button_control.rb +0 -13
  35. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_dialog_action_control.rb +0 -24
  36. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_filled_button_control.rb +0 -13
  37. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_navigation_bar_control.rb +0 -13
  38. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_slider_control.rb +0 -13
  39. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_switch_control.rb +0 -13
  40. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_text_field_control.rb +0 -13
  41. data/lib/ruflet_ui/ruflet/ui/controls/material/alert_dialog_control.rb +0 -13
  42. data/lib/ruflet_ui/ruflet/ui/controls/material/app_bar_control.rb +0 -13
  43. data/lib/ruflet_ui/ruflet/ui/controls/material/bottom_sheet_control.rb +0 -13
  44. data/lib/ruflet_ui/ruflet/ui/controls/material/button_control.rb +0 -24
  45. data/lib/ruflet_ui/ruflet/ui/controls/material/checkbox_control.rb +0 -13
  46. data/lib/ruflet_ui/ruflet/ui/controls/material/column_control.rb +0 -13
  47. data/lib/ruflet_ui/ruflet/ui/controls/material/container_control.rb +0 -13
  48. data/lib/ruflet_ui/ruflet/ui/controls/material/drag_target_control.rb +0 -13
  49. data/lib/ruflet_ui/ruflet/ui/controls/material/draggable_control.rb +0 -13
  50. data/lib/ruflet_ui/ruflet/ui/controls/material/elevated_button_control.rb +0 -13
  51. data/lib/ruflet_ui/ruflet/ui/controls/material/filled_button_control.rb +0 -13
  52. data/lib/ruflet_ui/ruflet/ui/controls/material/floating_action_button_control.rb +0 -28
  53. data/lib/ruflet_ui/ruflet/ui/controls/material/gesture_detector_control.rb +0 -13
  54. data/lib/ruflet_ui/ruflet/ui/controls/material/grid_view_control.rb +0 -13
  55. data/lib/ruflet_ui/ruflet/ui/controls/material/icon_button_control.rb +0 -13
  56. data/lib/ruflet_ui/ruflet/ui/controls/material/icon_control.rb +0 -24
  57. data/lib/ruflet_ui/ruflet/ui/controls/material/image_control.rb +0 -13
  58. data/lib/ruflet_ui/ruflet/ui/controls/material/markdown_control.rb +0 -13
  59. data/lib/ruflet_ui/ruflet/ui/controls/material/navigation_bar_control.rb +0 -13
  60. data/lib/ruflet_ui/ruflet/ui/controls/material/navigation_bar_destination_control.rb +0 -13
  61. data/lib/ruflet_ui/ruflet/ui/controls/material/radio_control.rb +0 -13
  62. data/lib/ruflet_ui/ruflet/ui/controls/material/radio_group_control.rb +0 -13
  63. data/lib/ruflet_ui/ruflet/ui/controls/material/row_control.rb +0 -13
  64. data/lib/ruflet_ui/ruflet/ui/controls/material/snack_bar_control.rb +0 -68
  65. data/lib/ruflet_ui/ruflet/ui/controls/material/stack_control.rb +0 -13
  66. data/lib/ruflet_ui/ruflet/ui/controls/material/tab_bar_control.rb +0 -13
  67. data/lib/ruflet_ui/ruflet/ui/controls/material/tab_bar_view_control.rb +0 -13
  68. data/lib/ruflet_ui/ruflet/ui/controls/material/tab_control.rb +0 -13
  69. data/lib/ruflet_ui/ruflet/ui/controls/material/tabs_control.rb +0 -63
  70. data/lib/ruflet_ui/ruflet/ui/controls/material/text_button_control.rb +0 -13
  71. data/lib/ruflet_ui/ruflet/ui/controls/material/text_control.rb +0 -13
  72. data/lib/ruflet_ui/ruflet/ui/controls/material/text_field_control.rb +0 -13
  73. data/lib/ruflet_ui/ruflet/ui/controls/material/view_control.rb +0 -13
  74. data/lib/ruflet_ui/ruflet/ui/cupertino_control_factory.rb +0 -40
  75. data/lib/ruflet_ui/ruflet/ui/cupertino_control_methods.rb +0 -26
  76. data/lib/ruflet_ui/ruflet/ui/cupertino_control_registry.rb +0 -49
  77. data/lib/ruflet_ui/ruflet/ui/material_control_factory.rb +0 -97
  78. data/lib/ruflet_ui/ruflet/ui/material_control_methods.rb +0 -128
  79. data/lib/ruflet_ui/ruflet/ui/material_control_registry.rb +0 -154
  80. data/lib/ruflet_ui/ruflet/ui/shared_control_forwarders.rb +0 -89
  81. data/lib/ruflet_ui/ruflet/ui/widget_builder.rb +0 -55
  82. data/lib/ruflet_ui.rb +0 -111
@@ -1,89 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Ruflet
4
- module UI
5
- module SharedControlForwarders
6
- def control(type, **props, &block) = control_delegate.control(type, **props, &block)
7
- def widget(type, **props, &block) = control_delegate.widget(type, **props, &block)
8
- def view(**props, &block) = control_delegate.view(**props, &block)
9
- def column(**props, &block) = control_delegate.column(**props, &block)
10
- def center(**props, &block) = control_delegate.center(**props, &block)
11
- def row(**props, &block) = control_delegate.row(**props, &block)
12
- def stack(**props, &block) = control_delegate.stack(**props, &block)
13
- def grid_view(**props, &block) = control_delegate.grid_view(**props, &block)
14
- def gridview(**props, &block) = control_delegate.gridview(**props, &block)
15
- def container(**props, &block) = control_delegate.container(**props, &block)
16
- def gesture_detector(**props, &block) = control_delegate.gesture_detector(**props, &block)
17
- def gesturedetector(**props, &block) = control_delegate.gesturedetector(**props, &block)
18
- def draggable(**props, &block) = control_delegate.draggable(**props, &block)
19
- def drag_target(**props, &block) = control_delegate.drag_target(**props, &block)
20
- def dragtarget(**props, &block) = control_delegate.dragtarget(**props, &block)
21
- def text(value = nil, **props) = control_delegate.text(value, **props)
22
- def button(**props) = control_delegate.button(**props)
23
- def elevated_button(**props) = control_delegate.elevated_button(**props)
24
- def elevatedbutton(**props) = control_delegate.elevatedbutton(**props)
25
- def text_button(**props) = control_delegate.text_button(**props)
26
- def textbutton(**props) = control_delegate.textbutton(**props)
27
- def filled_button(**props) = control_delegate.filled_button(**props)
28
- def filledbutton(**props) = control_delegate.filledbutton(**props)
29
- def icon_button(**props) = control_delegate.icon_button(**props)
30
- def iconbutton(**props) = control_delegate.iconbutton(**props)
31
- def text_field(**props) = control_delegate.text_field(**props)
32
- def textfield(**props) = control_delegate.textfield(**props)
33
- def checkbox(**props) = control_delegate.checkbox(**props)
34
- def radio(**props) = control_delegate.radio(**props)
35
- def radio_group(**props) = control_delegate.radio_group(**props)
36
- def radiogroup(**props) = control_delegate.radiogroup(**props)
37
- def alert_dialog(**props) = control_delegate.alert_dialog(**props)
38
- def alertdialog(**props) = control_delegate.alertdialog(**props)
39
- def snack_bar(**props) = control_delegate.snack_bar(**props)
40
- def snackbar(**props) = control_delegate.snackbar(**props)
41
- def bottom_sheet(**props) = control_delegate.bottom_sheet(**props)
42
- def bottomsheet(**props) = control_delegate.bottomsheet(**props)
43
- def markdown(value = nil, **props) = control_delegate.markdown(value, **props)
44
- def icon(**props) = control_delegate.icon(**props)
45
- def image(src = nil, **props) = control_delegate.image(src, **props)
46
- def fab(content = nil, **props) = control_delegate.fab(content, **props)
47
- def app_bar(**props) = control_delegate.app_bar(**props)
48
- def appbar(**props) = control_delegate.appbar(**props)
49
- def clipboard(**props) = control_delegate.clipboard(**props)
50
- def floating_action_button(**props) = control_delegate.floating_action_button(**props)
51
- def floatingactionbutton(**props) = control_delegate.floatingactionbutton(**props)
52
- def tabs(**props, &block) = control_delegate.tabs(**props, &block)
53
- def tab(**props, &block) = control_delegate.tab(**props, &block)
54
- def tab_bar(**props, &block) = control_delegate.tab_bar(**props, &block)
55
- def tabbar(**props, &block) = control_delegate.tabbar(**props, &block)
56
- def tab_bar_view(**props, &block) = control_delegate.tab_bar_view(**props, &block)
57
- def tabbarview(**props, &block) = control_delegate.tabbarview(**props, &block)
58
- def navigation_bar(**props, &block) = control_delegate.navigation_bar(**props, &block)
59
- def navigationbar(**props, &block) = control_delegate.navigationbar(**props, &block)
60
- def navigation_bar_destination(**props, &block) = control_delegate.navigation_bar_destination(**props, &block)
61
- def navigationbardestination(**props, &block) = control_delegate.navigationbardestination(**props, &block)
62
- def cupertino_button(**props) = control_delegate.cupertino_button(**props)
63
- def cupertinobutton(**props) = control_delegate.cupertinobutton(**props)
64
- def cupertino_filled_button(**props) = control_delegate.cupertino_filled_button(**props)
65
- def cupertinofilledbutton(**props) = control_delegate.cupertinofilledbutton(**props)
66
- def cupertino_text_field(**props) = control_delegate.cupertino_text_field(**props)
67
- def cupertinotextfield(**props) = control_delegate.cupertinotextfield(**props)
68
- def cupertino_switch(**props) = control_delegate.cupertino_switch(**props)
69
- def cupertinoswitch(**props) = control_delegate.cupertinoswitch(**props)
70
- def cupertino_slider(**props) = control_delegate.cupertino_slider(**props)
71
- def cupertinoslider(**props) = control_delegate.cupertinoslider(**props)
72
- def cupertino_alert_dialog(**props) = control_delegate.cupertino_alert_dialog(**props)
73
- def cupertinoalertdialog(**props) = control_delegate.cupertinoalertdialog(**props)
74
- def cupertino_action_sheet(**props) = control_delegate.cupertino_action_sheet(**props)
75
- def cupertinoactionsheet(**props) = control_delegate.cupertinoactionsheet(**props)
76
- def cupertino_dialog_action(**props) = control_delegate.cupertino_dialog_action(**props)
77
- def cupertinodialogaction(**props) = control_delegate.cupertinodialogaction(**props)
78
- def cupertino_navigation_bar(**props) = control_delegate.cupertino_navigation_bar(**props)
79
- def cupertinonavigationbar(**props) = control_delegate.cupertinonavigationbar(**props)
80
- def duration(**parts) = control_delegate.duration(**parts)
81
-
82
- private
83
-
84
- def control_delegate
85
- raise NotImplementedError, "control_delegate must be implemented by the including/extended context"
86
- end
87
- end
88
- end
89
- end
@@ -1,55 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "control_methods"
4
- require_relative "control_factory"
5
-
6
- module Ruflet
7
- class WidgetBuilder
8
- include UI::ControlMethods
9
-
10
- attr_reader :children
11
-
12
- def initialize
13
- @children = []
14
- end
15
-
16
- def widget(type, **props, &block)
17
- control(type, **props, &block)
18
- end
19
-
20
- def control(type, **props, &block)
21
- mapped_props = props.dup
22
- prop_children = extract_children_prop(mapped_props)
23
-
24
- node = UI::ControlFactory.build(type, **mapped_props)
25
- if block
26
- nested = WidgetBuilder.new
27
- block_result = nested.instance_eval(&block)
28
- if block_result.is_a?(Control) && !nested.children.any? { |c| c.object_id == block_result.object_id }
29
- nested.children << block_result
30
- end
31
- node.children.concat(nested.children)
32
- end
33
-
34
- if prop_children
35
- Array(prop_children).each do |child|
36
- node.children << child if child.is_a?(Control)
37
- end
38
- end
39
-
40
- @children << node
41
- node
42
- end
43
-
44
- def build_widget(type, **props, &block) = control(type, **props, &block)
45
-
46
- private
47
-
48
- def extract_children_prop(props)
49
- props.delete(:children) ||
50
- props.delete("children") ||
51
- props.delete(:controls) ||
52
- props.delete("controls")
53
- end
54
- end
55
- end
data/lib/ruflet_ui.rb DELETED
@@ -1,111 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "ruflet_protocol"
4
- require_relative "ruflet_ui/ruflet/colors"
5
- require_relative "ruflet_ui/ruflet/icon_data"
6
- require_relative "ruflet_ui/ruflet/icons/material_icons"
7
- require_relative "ruflet_ui/ruflet/icons/cupertino/cupertino_icons"
8
- require_relative "ruflet_ui/ruflet/control"
9
- require_relative "ruflet_ui/ruflet/ui/widget_builder"
10
- require_relative "ruflet_ui/ruflet/ui/shared_control_forwarders"
11
- require_relative "ruflet_ui/ruflet/event"
12
- require_relative "ruflet_ui/ruflet/page"
13
- require_relative "ruflet_ui/ruflet/app"
14
- require_relative "ruflet_ui/ruflet/dsl"
15
-
16
- module Ruflet
17
- module MainAxisAlignment
18
- CENTER = "center"
19
- START = "start"
20
- FINISH = "end"
21
- SPACE_BETWEEN = "spaceBetween"
22
- SPACE_AROUND = "spaceAround"
23
- SPACE_EVENLY = "spaceEvenly"
24
- end
25
-
26
- module CrossAxisAlignment
27
- CENTER = "center"
28
- START = "start"
29
- FINISH = "end"
30
- STRETCH = "stretch"
31
- end
32
-
33
- module TextAlign
34
- LEFT = "left"
35
- RIGHT = "right"
36
- CENTER = "center"
37
- JUSTIFY = "justify"
38
- START = "start"
39
- FINISH = "end"
40
- end
41
-
42
- module Icons
43
- class << self
44
- def const_missing(name)
45
- if Ruflet::MaterialIcons.const_defined?(name, false)
46
- return Ruflet::MaterialIcons.const_get(name)
47
- end
48
-
49
- if Ruflet::CupertinoIcons.const_defined?(name, false)
50
- return Ruflet::CupertinoIcons.const_get(name)
51
- end
52
-
53
- super
54
- end
55
-
56
- def [](name)
57
- key = name.to_s.upcase.to_sym
58
- return Ruflet::MaterialIcons.const_get(key) if Ruflet::MaterialIcons.const_defined?(key, false)
59
- return Ruflet::CupertinoIcons.const_get(key) if Ruflet::CupertinoIcons.const_defined?(key, false)
60
-
61
- Ruflet::IconData.new(name.to_s)
62
- end
63
- end
64
- end
65
-
66
- class << self
67
- include UI::SharedControlForwarders
68
-
69
- def app(host: "0.0.0.0", port: 8550, &block)
70
- DSL.app(host: host, port: port, &block)
71
- end
72
-
73
- private
74
-
75
- def control_delegate
76
- WidgetBuilder.new
77
- end
78
- end
79
-
80
- module UI
81
- class << self
82
- include SharedControlForwarders
83
-
84
- def app(**opts, &block) = Ruflet.app(**opts, &block)
85
- def page(**props, &block) = Ruflet::DSL.page(**props, &block)
86
-
87
- private
88
-
89
- def control_delegate
90
- Ruflet::DSL
91
- end
92
- end
93
- end
94
- end
95
-
96
- module Kernel
97
- include Ruflet::UI::SharedControlForwarders
98
-
99
- private
100
-
101
- def app(**opts, &block) = Ruflet::DSL.app(**opts, &block)
102
- def page(**props, &block) = Ruflet::DSL.page(**props, &block)
103
-
104
- def control_delegate
105
- Ruflet::DSL
106
- end
107
-
108
- if Ruflet::UI::SharedControlForwarders.respond_to?(:instance_methods)
109
- private(*Ruflet::UI::SharedControlForwarders.instance_methods(false))
110
- end
111
- end