lizarb 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +12 -13
  3. data/Rakefile +38 -0
  4. data/app/dev_box.rb +14 -12
  5. data/app/happy_box.rb +2 -2
  6. data/app/net_box.rb +4 -4
  7. data/app/web_box.rb +4 -4
  8. data/app.rb +6 -7
  9. data/{exe/Gemfile → app_global.gemfile.rb} +2 -0
  10. data/app_global.gemfile.rb.lock +19 -0
  11. data/app_global.rb +4 -0
  12. data/{app → app_new}/dev/benches/loops_bench.rb +3 -2
  13. data/{app/dev/generators/bench_generator_test.rb → app_new/dev/benches/loops_bench_test.rb} +2 -2
  14. data/app_new/dev/benches/objects_bench.rb +83 -0
  15. data/{app/dev/generators/record_generator_test.rb → app_new/dev/benches/objects_bench_test.rb} +2 -2
  16. data/app_new/dev/benches/sorted_bench.rb +54 -0
  17. data/app_new/dev/benches/sorted_bench_test.rb +12 -0
  18. data/app_new/dev/benches/variables_bench.rb +55 -0
  19. data/{app/dev/generators/command_generator_test.rb → app_new/dev/benches/variables_bench_test.rb} +2 -2
  20. data/{app → app_new}/dev/commands/calculator_command.rb +1 -1
  21. data/{app → app_new}/dev/commands/circle_command.rb +1 -1
  22. data/{app → app_new}/dev/commands/narrative_method_command.rb +5 -7
  23. data/{app → app_new}/dev/commands/quadratic_command.rb +1 -1
  24. data/app_new/dev_box.rb +14 -0
  25. data/app_new.rb +15 -0
  26. data/exe/lizarb +9 -1
  27. data/lib/app.rb +27 -95
  28. data/lib/dev_system/dev/controllers/bench/not_found_bench.rb +15 -8
  29. data/lib/dev_system/dev/controllers/bench.rb +0 -6
  30. data/lib/dev_system/dev/controllers/command/bench_command.rb +1 -2
  31. data/lib/dev_system/dev/controllers/command/generate_command.rb +3 -27
  32. data/lib/dev_system/dev/controllers/command/new_command.rb +9 -0
  33. data/lib/dev_system/dev/controllers/command/new_command_test.rb +7 -0
  34. data/lib/dev_system/dev/controllers/command/not_found_command.rb +29 -8
  35. data/lib/dev_system/dev/controllers/command/terminal_command.rb +2 -2
  36. data/lib/dev_system/dev/controllers/command/test_command.rb +6 -6
  37. data/lib/dev_system/dev/controllers/command.rb +9 -13
  38. data/lib/dev_system/dev/controllers/generator_dsl_main_part.rb +2 -4
  39. data/{app/dev/generators/bench_generator/bench.rb.erb → lib/dev_system/dev/controllers/generators/bench_generator/controller.rb.erb} +1 -2
  40. data/{app/dev/generators/bench_generator/bench_test.rb.erb → lib/dev_system/dev/controllers/generators/bench_generator/controller_test.rb.erb} +2 -2
  41. data/lib/dev_system/dev/controllers/generators/bench_generator.rb +12 -0
  42. data/lib/dev_system/dev/controllers/generators/bench_generator_test.rb +12 -0
  43. data/lib/dev_system/dev/controllers/generators/command_generator/controller.rb.erb +41 -0
  44. data/{app/dev/generators/command_generator/command_test.rb.erb → lib/dev_system/dev/controllers/generators/command_generator/controller_test.rb.erb} +2 -2
  45. data/lib/dev_system/dev/controllers/generators/command_generator.rb +19 -0
  46. data/lib/dev_system/dev/controllers/generators/command_generator_test.rb +12 -0
  47. data/lib/dev_system/dev/controllers/generators/controller_generator.rb +97 -0
  48. data/lib/dev_system/dev/controllers/generators/controller_generator_test.rb +12 -0
  49. data/lib/dev_system/dev/controllers/generators/generator_generator/template.rb.erb +1 -1
  50. data/lib/dev_system/dev/controllers/generators/new_generator.rb +117 -0
  51. data/lib/dev_system/dev/controllers/generators/new_generator_test.rb +12 -0
  52. data/lib/dev_system/dev/controllers/generators/not_found_generator.rb +20 -8
  53. data/{app/dev → lib/dev_system/dev/controllers}/generators/record_generator.rb +1 -1
  54. data/lib/dev_system/dev/controllers/generators/record_generator_test.rb +12 -0
  55. data/{app/dev → lib/dev_system/dev/controllers}/generators/request_generator.rb +2 -2
  56. data/lib/dev_system/dev/controllers/generators/request_generator_test.rb +12 -0
  57. data/lib/dev_system/dev/controllers/log.rb +3 -0
  58. data/{app/dev/generators/request_generator_test.rb → lib/dev_system/dev/controllers/log_test.rb} +2 -2
  59. data/lib/dev_system/dev/controllers/shell.rb +22 -0
  60. data/lib/dev_system/dev/controllers/shell_test.rb +25 -0
  61. data/lib/dev_system/dev/controllers/terminal/irb_terminal.rb +7 -1
  62. data/lib/dev_system/dev/controllers/terminal/pry_terminal.rb +1 -1
  63. data/lib/dev_system/dev/dev_box.rb +12 -18
  64. data/lib/dev_system/dev/panels/command_panel.rb +54 -11
  65. data/lib/dev_system/dev/panels/command_panel_test.rb +35 -10
  66. data/lib/dev_system/dev/panels/generator_panel.rb +70 -0
  67. data/lib/dev_system/dev/panels/generator_panel_test.rb +34 -0
  68. data/lib/happy_system/happy/happy_box.rb +2 -3
  69. data/lib/lerb.rb +95 -49
  70. data/lib/liza/base/box.rb +6 -1
  71. data/lib/liza/base/panel.rb +16 -18
  72. data/lib/liza/base/panel_test.rb +27 -1
  73. data/lib/liza/base_parts/controller_renderer_part.rb +1 -1
  74. data/lib/liza/ruby_tests/module_test.rb +2 -2
  75. data/lib/liza/test/test_test.rb +5 -1
  76. data/lib/liza/test_parts/test_assertions_part.rb +1 -1
  77. data/lib/liza/test_parts/test_dsl_part.rb +3 -3
  78. data/lib/liza/test_parts/test_tree_part.rb +4 -49
  79. data/lib/liza/unit.rb +73 -79
  80. data/lib/liza/unit_parts/unit_procedure_part_test.rb +9 -9
  81. data/lib/liza/unit_parts/unit_settings_part.rb +76 -0
  82. data/lib/liza/unit_parts/unit_settings_part_test.rb +3 -0
  83. data/lib/liza/unit_test.rb +11 -0
  84. data/lib/liza.rb +10 -1
  85. data/lib/lizarb/ruby/module.rb +1 -1
  86. data/lib/lizarb/version.rb +1 -1
  87. data/lib/lizarb.rb +247 -23
  88. data/lib/net_system/dev/net_command.rb +9 -9
  89. data/lib/net_system/net/controllers/client/redis_client.rb +1 -1
  90. data/lib/net_system/net/controllers/client/sqlite_client.rb +1 -1
  91. data/lib/net_system/net/net_box.rb +4 -6
  92. data/lib/web_system/dev/rack_command.rb +1 -8
  93. data/lib/web_system/dev/request_command.rb +6 -20
  94. data/lib/web_system/web/panels/request_panel.rb +0 -2
  95. data/lib/web_system/web/web_box.rb +4 -6
  96. data/lizarb.gemspec +1 -1
  97. metadata +46 -41
  98. data/.ruby-version +0 -1
  99. data/app/dev/benches/app_bench.rb +0 -5
  100. data/app/dev/benches/app_bench_test.rb +0 -7
  101. data/app/dev/benches/loops_bench_test.rb +0 -11
  102. data/app/dev/commands/app_command.rb +0 -5
  103. data/app/dev/commands/app_command_test.rb +0 -7
  104. data/app/dev/commands/new_command.rb +0 -9
  105. data/app/dev/commands/new_command_test.rb +0 -7
  106. data/app/dev/generators/bench_generator.rb +0 -18
  107. data/app/dev/generators/command_generator/command.rb.erb +0 -26
  108. data/app/dev/generators/command_generator.rb +0 -18
  109. data/exe/Gemfile.lock +0 -13
  110. data/lib/dev_system/dev/controllers/bench_dsl_main_part.rb +0 -58
  111. data/lib/dev_system/dev/controllers/command/echo_command.rb +0 -9
  112. data/lib/dev_system/dev/controllers/command/echo_command_test.rb +0 -12
  113. data/lib/dev_system/dev/controllers/command/version_command.rb +0 -7
  114. data/lib/dev_system/dev/controllers/command/version_command_test.rb +0 -12
  115. data/lib/dev_system/dev/controllers/generators/app_generator.rb +0 -146
  116. data/lib/dev_system/dev/controllers/generators/app_generator_test.rb +0 -12
  117. /data/{app → app_new}/dev/commands/calculator_command_test.rb +0 -0
  118. /data/{app → app_new}/dev/commands/circle_command_test.rb +0 -0
  119. /data/{app → app_new}/dev/commands/narrative_method_command_test.rb +0 -0
  120. /data/{app → app_new}/dev/commands/quadratic_command_test.rb +0 -0
@@ -1,146 +0,0 @@
1
- class DevSystem::AppGenerator < DevSystem::Generator
2
-
3
- def self.call args
4
- log :higher, "Called #{self}.#{__method__} with args #{args}"
5
- new.call args
6
- end
7
-
8
- def call args
9
- # setup
10
-
11
- name = args.shift || "app_1"
12
-
13
- from = "#{Lizarb::APP_DIR}/app_new"
14
- to = name
15
-
16
- return log "Directory #{to.light_green} already exists." if Dir.exist? to
17
-
18
- log "Liza Application initializing at `#{to}`"
19
-
20
- # init
21
-
22
- DirShell.create to
23
- TextShell.write "#{to}/.gitignore", render("hidden.gitignore")
24
- TextShell.write "#{to}/Gemfile", render("Gemfile.rb")
25
- TextShell.write "#{to}/Procfile", render("Procfile.yml")
26
-
27
- `cd #{to}; git init -b main`
28
-
29
- # extra
30
-
31
- puts
32
-
33
- FileShell.gitkeep "#{to}/lib"
34
- FileShell.gitkeep "#{to}/tmp"
35
-
36
- DirShell.create "#{to}/app"
37
-
38
- # systems
39
-
40
- # App.systems.keys.each { |system_name| copy to, system_name }
41
- copy to, :dev
42
-
43
- FileUtils.rm "#{to}/app/dev/commands/new_command.rb"
44
- FileUtils.rm "#{to}/app/dev/commands/new_command_test.rb"
45
-
46
- `rm -rf #{to}/app/dev/generators/record_generator*`
47
- `rm -rf #{to}/app/dev/generators/request_generator*`
48
-
49
- FileUtils.cp_r "#{Lizarb::APP_DIR}/.ruby-version", "#{to}/.ruby-version", verbose: true
50
- FileUtils.cp_r "#{Lizarb::APP_DIR}/README.md", "#{to}/README.md", verbose: true
51
- TextShell.write "#{to}/app.rb", render("app.rb")
52
- FileUtils.cp_r "#{Lizarb::APP_DIR}/app.env", "#{to}/app.env", verbose: true
53
- FileUtils.cp_r "#{Lizarb::APP_DIR}/app.code.env", "#{to}/app.code.env", verbose: true
54
-
55
- puts
56
-
57
- log "Liza Application initialized at `#{to}`"
58
- end
59
-
60
- def copy name, system_name
61
- from = "#{Lizarb::APP_DIR}/app/#{system_name}_box.rb"
62
- to = "#{name}/app"
63
- if File.exist? from
64
- FileUtils.cp_r from, to, verbose: true
65
- else
66
- puts "file not found #{from}"
67
- end
68
-
69
- from = "#{Lizarb::APP_DIR}/app/#{system_name}"
70
- to = "#{name}/app"
71
- if File.exist? from
72
- FileUtils.cp_r from, to, verbose: true
73
- else
74
- puts "file not found #{from}"
75
- end
76
- end
77
-
78
- end
79
-
80
- __END__
81
-
82
- # app.rb.erb
83
- App.call ARGV do
84
-
85
- # Systems help you organize your application's dependencies and RAM memory usage.
86
- # Learn more: http://guides.lizarb.org/systems.html
87
-
88
- system :dev
89
-
90
- # Modes help you organize your application's behavior and settings.
91
- # Learn more: http://guides.lizarb.org/modes.html
92
-
93
- mode :code
94
- mode :demo
95
-
96
- end
97
-
98
- # hidden.gitignore.erb
99
-
100
- # Ignore all files in all subdirectories
101
- .gitignore/.bundle/
102
- /tmp/
103
- *.sqlite
104
- *.rdb
105
-
106
- # Procfile.yml.erb
107
-
108
- <%= "# HEROKU EXAMPLE" %>
109
-
110
- web: LIZA_MODE=demo bundle exec liza rack h=0.0.0.0 p=$PORT
111
-
112
- # Gemfile.rb.erb
113
-
114
- <%= "# frozen_string_literal: true" %>
115
-
116
- source "https://rubygems.org"
117
-
118
- ruby File.read(".ruby-version").strip
119
-
120
- group :default do
121
- gem "lizarb", "~> <%= Lizarb::VERSION %>"
122
- # gem "lizarb", github: "rubyonrails-brasil/lizarb"
123
- end
124
-
125
- group :dev do
126
- # gems you only want to load if DevSystem is loaded
127
- # gem "pry", "~> 0.14.1"
128
- end
129
-
130
- group :happy do
131
- # gems you only want to load if HappySystem is loaded
132
- end
133
-
134
- group :net do
135
- # gems you only want to load if NetSystem is loaded
136
- # gem "redis", "~> 5.0"
137
- # gem "sqlite3", "~> 1.5"
138
- end
139
-
140
- group :web do
141
- # gems you only want to load if WebSystem is loaded
142
- # gem "rack", "~> 3.0"
143
- # gem "rackup", "~> 0.2.2"
144
- # gem "puma", "~> 5.6"
145
- # gem "htmlbeautifier", "~> 1.4"
146
- end
@@ -1,12 +0,0 @@
1
- class DevSystem::AppGeneratorTest < DevSystem::GeneratorTest
2
-
3
- test :subject_class do
4
- assert subject_class == DevSystem::AppGenerator
5
- end
6
-
7
- test :settings do
8
- assert subject_class.log_level == :normal
9
- assert subject_class.log_color == :green
10
- end
11
-
12
- end