lizarb 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.tool-versions +1 -0
  4. data/Gemfile +2 -0
  5. data/Gemfile.lock +14 -3
  6. data/README.md +23 -64
  7. data/README_SYSTEMS.md +80 -0
  8. data/Rakefile +3 -1
  9. data/app/dev/benches/app_bench.rb +5 -0
  10. data/app/dev/benches/app_bench_test.rb +7 -0
  11. data/app/dev/benches/loops_bench.rb +183 -0
  12. data/app/dev/benches/loops_bench_test.rb +11 -0
  13. data/app/dev/commands/calculator_command.rb +69 -0
  14. data/app/dev/commands/calculator_command_test.rb +58 -0
  15. data/app/dev/commands/circle_command.rb +70 -0
  16. data/app/dev/commands/circle_command_test.rb +76 -0
  17. data/app/dev/commands/narrative_method_command.rb +60 -0
  18. data/app/dev/commands/narrative_method_command_test.rb +36 -0
  19. data/app/dev/commands/new_command.rb +1 -61
  20. data/app/dev/commands/quadratic_command.rb +66 -0
  21. data/app/dev/commands/quadratic_command_test.rb +47 -0
  22. data/app/dev/generators/bench_generator/bench.rb.erb +24 -0
  23. data/app/dev/generators/bench_generator/bench_test.rb.erb +12 -0
  24. data/app/dev/generators/bench_generator.rb +18 -0
  25. data/app/dev/generators/bench_generator_test.rb +12 -0
  26. data/app/dev/generators/command_generator/command.rb.erb +26 -0
  27. data/app/dev/generators/command_generator/command_test.rb.erb +12 -0
  28. data/app/dev/generators/command_generator.rb +18 -0
  29. data/app/dev/generators/command_generator_test.rb +12 -0
  30. data/app/dev/generators/record_generator.rb +46 -0
  31. data/app/dev/generators/record_generator_test.rb +12 -0
  32. data/app/dev/generators/request_generator.rb +63 -0
  33. data/app/dev/generators/request_generator_test.rb +12 -0
  34. data/app/net/databases/redis_db_test.rb +2 -2
  35. data/app/net/databases/sqlite_db_test.rb +2 -2
  36. data/app/net/{models/app_model.rb → records/app_record.rb} +2 -1
  37. data/app/net/{models/post_model_test.rb → records/app_record_test.rb} +2 -2
  38. data/app/net/records/post_record.rb +4 -0
  39. data/app/net/{models/app_model_test.rb → records/post_record_test.rb} +2 -2
  40. data/app/net/records/user_record.rb +4 -0
  41. data/app/net/{models/user_model_test.rb → records/user_record_test.rb} +2 -2
  42. data/app/net_box.rb +2 -2
  43. data/app/web/requests/api_request.rb +8 -7
  44. data/app/web/requests/assets_request.rb +12 -13
  45. data/app/web/requests/root_request.rb +6 -7
  46. data/app/web/requests/root_request_test.rb +1 -1
  47. data/app/web_box.rb +8 -0
  48. data/app_new/Procfile +1 -1
  49. data/exe/lrb +3 -0
  50. data/lib/app.rb +18 -14
  51. data/lib/dev_system/dev/controllers/bench/not_found_bench.rb +29 -0
  52. data/lib/dev_system/dev/controllers/bench/not_found_bench_test.rb +14 -0
  53. data/lib/dev_system/dev/controllers/bench.rb +11 -0
  54. data/lib/dev_system/dev/controllers/bench_dsl_main_part.rb +60 -0
  55. data/lib/dev_system/dev/controllers/{command/dev_command_test.rb → bench_test.rb} +2 -2
  56. data/lib/dev_system/dev/controllers/command/bench_command.rb +34 -0
  57. data/lib/dev_system/dev/controllers/command/bench_command_test.rb +14 -0
  58. data/lib/dev_system/dev/controllers/command/generate_command.rb +35 -0
  59. data/lib/dev_system/dev/controllers/command/generate_command_test.rb +14 -0
  60. data/lib/dev_system/dev/controllers/command/not_found_command.rb +29 -0
  61. data/lib/dev_system/dev/controllers/command/not_found_command_test.rb +14 -0
  62. data/lib/dev_system/dev/controllers/command/terminal_command.rb +24 -0
  63. data/lib/dev_system/dev/controllers/command/terminal_command_test.rb +14 -0
  64. data/lib/dev_system/dev/controllers/command/test_command.rb +6 -2
  65. data/lib/dev_system/dev/controllers/generator.rb +11 -0
  66. data/lib/dev_system/dev/controllers/generator_dsl_main_part.rb +54 -0
  67. data/lib/dev_system/dev/controllers/generator_test.rb +14 -0
  68. data/lib/dev_system/dev/controllers/generators/app_generator.rb +96 -0
  69. data/lib/dev_system/dev/controllers/generators/app_generator_test.rb +14 -0
  70. data/lib/dev_system/dev/controllers/generators/generator_generator/generator.rb.erb +18 -0
  71. data/lib/dev_system/dev/controllers/generators/generator_generator/generator_test.rb.erb +12 -0
  72. data/lib/dev_system/dev/controllers/generators/generator_generator/template.rb.erb +9 -0
  73. data/lib/dev_system/dev/controllers/generators/generator_generator/template_test.rb.erb +12 -0
  74. data/lib/dev_system/dev/controllers/generators/generator_generator.rb +30 -0
  75. data/lib/dev_system/dev/controllers/generators/generator_generator_test.rb +12 -0
  76. data/lib/dev_system/dev/controllers/generators/not_found_generator.rb +29 -0
  77. data/lib/dev_system/dev/controllers/generators/not_found_generator_test.rb +14 -0
  78. data/lib/dev_system/dev/controllers/shell/bin_shell.rb +22 -0
  79. data/lib/dev_system/dev/controllers/shell/bin_shell_test.rb +87 -0
  80. data/lib/dev_system/dev/controllers/shell/dir_shell.rb +27 -0
  81. data/lib/dev_system/dev/controllers/shell/dir_shell_test.rb +73 -0
  82. data/lib/dev_system/dev/controllers/shell/file_shell.rb +59 -0
  83. data/lib/dev_system/dev/controllers/shell/file_shell_test.rb +150 -0
  84. data/lib/dev_system/dev/controllers/shell/text_shell.rb +23 -0
  85. data/lib/dev_system/dev/controllers/shell/text_shell_test.rb +84 -0
  86. data/lib/dev_system/dev/controllers/shell.rb +31 -0
  87. data/lib/dev_system/dev/controllers/shell_test.rb +46 -0
  88. data/lib/dev_system/dev/controllers/{command/dev_command.rb → terminal/irb_terminal.rb} +2 -2
  89. data/lib/dev_system/dev/controllers/terminal/irb_terminal_test.rb +14 -0
  90. data/lib/dev_system/dev/controllers/terminal/pry_terminal.rb +12 -0
  91. data/lib/dev_system/dev/controllers/terminal/pry_terminal_test.rb +14 -0
  92. data/lib/dev_system/dev/controllers/terminal.rb +19 -0
  93. data/lib/dev_system/dev/controllers/terminal_test.rb +14 -0
  94. data/lib/dev_system/dev/dev_box.rb +3 -0
  95. data/lib/dev_system/dev/panels/command_panel.rb +21 -1
  96. data/lib/dev_system/dev/panels/log_panel.rb +1 -1
  97. data/lib/lerb.rb +106 -0
  98. data/lib/liza/base/controller.rb +2 -0
  99. data/lib/liza/base/panel.rb +6 -5
  100. data/lib/liza/base_parts/controller_renderer_part.rb +140 -0
  101. data/lib/liza/base_parts/controller_renderer_part_test.rb +16 -0
  102. data/lib/liza/meta/part_extension.rb +6 -1
  103. data/lib/liza/ruby_test.rb +9 -0
  104. data/lib/liza/ruby_tests/module_test.rb +21 -0
  105. data/lib/liza/ruby_tests/string_test.rb +59 -0
  106. data/lib/liza/test/test.rb +3 -1
  107. data/lib/liza/test/test_test.rb +108 -15
  108. data/lib/liza/test_parts/test_assertions_advanced_part.rb +127 -0
  109. data/lib/liza/test_parts/test_assertions_part.rb +7 -6
  110. data/lib/liza/test_parts/test_dsl_part.rb +37 -89
  111. data/lib/liza/test_parts/test_log_part.rb +124 -0
  112. data/lib/liza/test_parts/test_subject_part.rb +6 -1
  113. data/lib/liza/test_parts/test_tree_part.rb +139 -0
  114. data/lib/liza/unit.rb +2 -0
  115. data/lib/liza/unit_parts/unit_procedure_part.rb +17 -0
  116. data/lib/liza/unit_parts/unit_procedure_part_test.rb +65 -0
  117. data/lib/liza.rb +40 -7
  118. data/lib/lizarb/ruby/class.rb +2 -0
  119. data/lib/lizarb/ruby/module.rb +17 -0
  120. data/lib/lizarb/ruby/proc.rb +12 -0
  121. data/lib/lizarb/ruby/string.rb +26 -2
  122. data/lib/lizarb/version.rb +1 -1
  123. data/lib/lizarb.rb +24 -2
  124. data/lib/net_system/net/controllers/{adapter/redis_adapter.rb → client/redis_client.rb} +2 -2
  125. data/lib/net_system/net/controllers/{adapter/redis_adapter_test.rb → client/redis_client_test.rb} +2 -2
  126. data/lib/net_system/net/controllers/{adapter/sqlite_adapter.rb → client/sqlite_client.rb} +2 -2
  127. data/lib/net_system/net/controllers/{adapter/sqlite_adapter_test.rb → client/sqlite_client_test.rb} +2 -2
  128. data/lib/net_system/net/controllers/client.rb +5 -0
  129. data/lib/net_system/net/controllers/{model_test.rb → client_test.rb} +2 -2
  130. data/lib/net_system/net/controllers/database/redis_db.rb +2 -2
  131. data/lib/net_system/net/controllers/database/redis_db_test.rb +1 -1
  132. data/lib/net_system/net/controllers/database/sqlite_db.rb +2 -2
  133. data/lib/net_system/net/controllers/database/sqlite_db_test.rb +1 -1
  134. data/lib/net_system/net/controllers/database.rb +6 -6
  135. data/lib/net_system/net/controllers/record.rb +31 -0
  136. data/lib/net_system/net/controllers/{adapter_test.rb → record_test.rb} +2 -2
  137. data/lib/net_system/net/net_box.rb +5 -5
  138. data/lib/net_system/net/net_box_test.rb +1 -1
  139. data/lib/net_system/net/panels/client_panel.rb +5 -0
  140. data/lib/net_system/net/panels/{adapter_panel_test.rb → client_panel_test.rb} +2 -2
  141. data/lib/web_system/dev/rack_command.rb +26 -0
  142. data/lib/web_system/dev/request_command.rb +143 -0
  143. data/lib/web_system/dev/web_command.rb +3 -34
  144. data/lib/web_system/web/controllers/rack.rb +8 -0
  145. data/lib/web_system/web/controllers/rack_test.rb +18 -0
  146. data/lib/web_system/web/controllers/request/client_error_request.rb +0 -1
  147. data/lib/web_system/web/controllers/request/not_found_request.rb +0 -1
  148. data/lib/web_system/web/controllers/request/server_error_request.rb +0 -1
  149. data/lib/web_system/web/panels/rack_panel.rb +44 -0
  150. data/lib/web_system/web/panels/rack_panel_test.rb +14 -0
  151. data/lib/web_system/web/panels/request_panel.rb +51 -32
  152. data/lib/web_system/web/panels/request_panel_test.rb +28 -9
  153. data/lib/web_system/web/web_box.rb +12 -0
  154. data/lizarb.gemspec +2 -2
  155. data/tmp/.gitkeep +0 -0
  156. metadata +110 -31
  157. data/app/dev/commands/example_command.rb +0 -57
  158. data/app/dev/commands/example_command_test.rb +0 -43
  159. data/app/dev/commands/macro_child_command.rb +0 -32
  160. data/app/dev/commands/macro_child_command_test.rb +0 -7
  161. data/app/dev/commands/macro_parent_command.rb +0 -70
  162. data/app/dev/commands/macro_parent_command_test.rb +0 -7
  163. data/app/dev/commands/my_command.rb +0 -7
  164. data/app/dev/commands/my_command_test.rb +0 -7
  165. data/app/net/models/post_model.rb +0 -4
  166. data/app/net/models/user_model.rb +0 -4
  167. data/lib/liza/test_parts/test_context_part.rb +0 -81
  168. data/lib/net_system/net/controllers/adapter.rb +0 -5
  169. data/lib/net_system/net/controllers/model.rb +0 -31
  170. data/lib/net_system/net/panels/adapter_panel.rb +0 -5
@@ -2,53 +2,72 @@ class WebSystem
2
2
  class RequestPanel < Liza::Panel
3
3
 
4
4
  def call env
5
- puts
6
-
7
- # 1. LOG GET /
8
-
9
- log "#{env["REQUEST_METHOD"]} #{env["REQUEST_PATH"]}"
5
+ t = Time.now
6
+ request_klass = find env
7
+ ret = request_klass.call env
8
+ _html_beautify env, ret
9
+ ret
10
+ rescue => e
11
+ request_klass = ServerErrorRequest
12
+ env["LIZA_ERROR"] = e
10
13
 
11
- # 2. PREPARE env
14
+ ret = request_klass.call env
15
+ ensure
16
+ log "#{ret[0]} with #{ret[2].first.size} bytes in #{t.diff}s"
17
+ puts
18
+ ret
19
+ end
12
20
 
13
- path = env["REQUEST_PATH"]
21
+ #
14
22
 
15
- path, _sep, format = path.lpartition "."
16
- format = "html" if format.empty?
23
+ def find env
24
+ _prepare env
17
25
 
18
- segments = Array path.split("/")[1..-1]
26
+ path = env["LIZA_PATH"]
19
27
 
20
- case segments.count
21
- when 0
22
- request, action = "root", "root"
23
- when 1
24
- request, action = "root", segments[0]
25
- else
26
- request, action = segments[0..1]
27
- end
28
+ segments = env["LIZA_SEGMENTS"].dup
29
+ request = segments.shift || "root"
30
+ action = segments.shift || "index"
28
31
 
29
- env["LIZA_PATH"] = path
30
32
  env["LIZA_REQUEST"] = request
31
33
  env["LIZA_ACTION"] = action
32
- env["LIZA_FORMAT"] = format
34
+ format = env["LIZA_FORMAT"]
33
35
 
34
36
  log({request:, action:, format:})
35
37
 
36
- # 3. FIND request
38
+ env["LIZA_REQUEST_CLASS"] = _find_request_class request
39
+ end
37
40
 
38
- begin
39
- request_klass = Liza.const "#{request}_request"
40
- rescue NameError
41
- request_klass = NotFoundRequest
42
- end
41
+ def _find_request_class request
42
+ Liza.const "#{request}_request"
43
+ rescue NameError
44
+ NotFoundRequest
45
+ end
43
46
 
44
- # 4. CALL
47
+ #
45
48
 
46
- request_klass.call env
47
- rescue => e
48
- request_klass = ServerErrorRequest
49
- env["LIZA_ERROR"] = e
49
+ def _html_beautify env, ret
50
+ return unless defined? HtmlBeautifier
51
+ return unless env["LIZA_FORMAT"] == "html"
52
+
53
+ body = ret[2].first
54
+ body = HtmlBeautifier.beautify body
55
+ ret[2] = [body]
56
+ end
57
+
58
+ def _prepare env
59
+ log "#{env["REQUEST_METHOD"]} #{env["REQUEST_PATH"]}"
60
+
61
+ path = env["REQUEST_PATH"]
62
+
63
+ path, _sep, format = path.lpartition "."
64
+ format = "html" if format.empty?
65
+
66
+ segments = Array path.split("/")[1..-1]
50
67
 
51
- request_klass.call env
68
+ env["LIZA_PATH"] = path
69
+ env["LIZA_FORMAT"] = format
70
+ env["LIZA_SEGMENTS"] = segments
52
71
  end
53
72
 
54
73
  end
@@ -1,14 +1,33 @@
1
- class WebSystem
2
- class RequestPanelTest < Liza::PanelTest
1
+ class WebSystem::RequestPanelTest < Liza::PanelTest
3
2
 
4
- test :settings do
5
- assert subject_class.log_level == :normal
6
- assert subject_class.log_color == :blue
7
- end
3
+ test :settings do
4
+ assert subject_class.log_level == :normal
5
+ assert subject_class.log_color == :blue
6
+ end
7
+
8
+ #
8
9
 
9
- # test :call do
10
- # todo "write this"
11
- # end
10
+ test :_prepare do
11
+ subject = WebSystem::WebBox.requests
12
+ env = {}
13
+ env["REQUEST_PATH"] = "/foo/bar/baz"
14
+ subject._prepare env
15
+ assert_equality env, {
16
+ "REQUEST_PATH"=>"/foo/bar/baz",
17
+ "LIZA_PATH"=>"/foo/bar/baz",
18
+ "LIZA_FORMAT"=>"html",
19
+ "LIZA_SEGMENTS"=>["foo", "bar", "baz"]
20
+ }
12
21
 
22
+ env = {}
23
+ env["REQUEST_PATH"] = "/"
24
+ subject._prepare env
25
+ assert_equality env, {
26
+ "REQUEST_PATH"=>"/",
27
+ "LIZA_PATH"=>"/",
28
+ "LIZA_FORMAT"=>"html",
29
+ "LIZA_SEGMENTS"=>[]
30
+ }
13
31
  end
32
+
14
33
  end
@@ -1,11 +1,23 @@
1
1
  class WebSystem
2
2
  class WebBox < Liza::Box
3
+ has_panel :rack, :rack
4
+ has_controller :rack, :rack
3
5
  has_panel :request, :requests
4
6
  has_controller :request, :requests
5
7
 
8
+ # Set up your rack panel per the DSL in http://guides.lizarb.org/panels/rack.html
9
+ rack do
10
+ # set :log_level, ENV["web.rack.log_level"]
11
+
12
+ set :files, App.root.join("web_files")
13
+ set :host, "localhost"
14
+ set :port, 3000
15
+ end
16
+
6
17
  # Set up your request panel per the DSL in http://guides.lizarb.org/panels/request.html
7
18
  requests do
8
19
  # set :log_level, ENV["web.request.log_level"]
20
+
9
21
  end
10
22
 
11
23
  end
data/lizarb.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = "Liza is a light, experimental framework primarily developed to help study the Ruby language and the Ruby ecosystem."
13
13
  spec.homepage = "http://lizarb.org"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = ">= 3.1.0"
15
+ spec.required_ruby_version = ">= 3.2.0"
16
16
 
17
17
  spec.metadata = {
18
18
  "homepage_uri" => "https://github.com/rubyonrails-brasil/lizarb",
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  end
30
30
  end
31
31
  spec.bindir = "exe"
32
- spec.executables = ["liza", "lizarb"]
32
+ spec.executables = ["lrb", "liza", "lizarb"]
33
33
  spec.require_paths = ["lib"]
34
34
 
35
35
  # dependencies
data/tmp/.gitkeep ADDED
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lizarb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Pinto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-11 00:00:00.000000000 Z
11
+ date: 2023-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -70,34 +70,53 @@ description: Liza is a light, experimental framework primarily developed to help
70
70
  the Ruby language and the Ruby ecosystem.
71
71
  email: thiagopintodev@gmail.com
72
72
  executables:
73
+ - lrb
73
74
  - liza
74
75
  - lizarb
75
76
  extensions: []
76
77
  extra_rdoc_files: []
77
78
  files:
78
79
  - ".ruby-version"
80
+ - ".tool-versions"
79
81
  - CHANGELOG.md
80
82
  - CODE_OF_CONDUCT.md
81
83
  - Gemfile
82
84
  - Gemfile.lock
83
85
  - LICENSE.txt
84
86
  - README.md
87
+ - README_SYSTEMS.md
85
88
  - Rakefile
86
89
  - app.code.env
87
90
  - app.env
88
91
  - app.rb
92
+ - app/dev/benches/app_bench.rb
93
+ - app/dev/benches/app_bench_test.rb
94
+ - app/dev/benches/loops_bench.rb
95
+ - app/dev/benches/loops_bench_test.rb
89
96
  - app/dev/commands/app_command.rb
90
97
  - app/dev/commands/app_command_test.rb
91
- - app/dev/commands/example_command.rb
92
- - app/dev/commands/example_command_test.rb
93
- - app/dev/commands/macro_child_command.rb
94
- - app/dev/commands/macro_child_command_test.rb
95
- - app/dev/commands/macro_parent_command.rb
96
- - app/dev/commands/macro_parent_command_test.rb
97
- - app/dev/commands/my_command.rb
98
- - app/dev/commands/my_command_test.rb
98
+ - app/dev/commands/calculator_command.rb
99
+ - app/dev/commands/calculator_command_test.rb
100
+ - app/dev/commands/circle_command.rb
101
+ - app/dev/commands/circle_command_test.rb
102
+ - app/dev/commands/narrative_method_command.rb
103
+ - app/dev/commands/narrative_method_command_test.rb
99
104
  - app/dev/commands/new_command.rb
100
105
  - app/dev/commands/new_command_test.rb
106
+ - app/dev/commands/quadratic_command.rb
107
+ - app/dev/commands/quadratic_command_test.rb
108
+ - app/dev/generators/bench_generator.rb
109
+ - app/dev/generators/bench_generator/bench.rb.erb
110
+ - app/dev/generators/bench_generator/bench_test.rb.erb
111
+ - app/dev/generators/bench_generator_test.rb
112
+ - app/dev/generators/command_generator.rb
113
+ - app/dev/generators/command_generator/command.rb.erb
114
+ - app/dev/generators/command_generator/command_test.rb.erb
115
+ - app/dev/generators/command_generator_test.rb
116
+ - app/dev/generators/record_generator.rb
117
+ - app/dev/generators/record_generator_test.rb
118
+ - app/dev/generators/request_generator.rb
119
+ - app/dev/generators/request_generator_test.rb
101
120
  - app/dev_box.rb
102
121
  - app/happy/axos/axo.rb
103
122
  - app/happy_box.rb
@@ -105,12 +124,12 @@ files:
105
124
  - app/net/databases/redis_db_test.rb
106
125
  - app/net/databases/sqlite_db.rb
107
126
  - app/net/databases/sqlite_db_test.rb
108
- - app/net/models/app_model.rb
109
- - app/net/models/app_model_test.rb
110
- - app/net/models/post_model.rb
111
- - app/net/models/post_model_test.rb
112
- - app/net/models/user_model.rb
113
- - app/net/models/user_model_test.rb
127
+ - app/net/records/app_record.rb
128
+ - app/net/records/app_record_test.rb
129
+ - app/net/records/post_record.rb
130
+ - app/net/records/post_record_test.rb
131
+ - app/net/records/user_record.rb
132
+ - app/net/records/user_record_test.rb
114
133
  - app/net_box.rb
115
134
  - app/web/requests/api_request.rb
116
135
  - app/web/requests/api_request_test.rb
@@ -128,18 +147,59 @@ files:
128
147
  - exe/Gemfile.lock
129
148
  - exe/liza
130
149
  - exe/lizarb
150
+ - exe/lrb
131
151
  - lib/app.rb
132
152
  - lib/dev_system.rb
153
+ - lib/dev_system/dev/controllers/bench.rb
154
+ - lib/dev_system/dev/controllers/bench/not_found_bench.rb
155
+ - lib/dev_system/dev/controllers/bench/not_found_bench_test.rb
156
+ - lib/dev_system/dev/controllers/bench_dsl_main_part.rb
157
+ - lib/dev_system/dev/controllers/bench_test.rb
133
158
  - lib/dev_system/dev/controllers/command.rb
134
- - lib/dev_system/dev/controllers/command/dev_command.rb
135
- - lib/dev_system/dev/controllers/command/dev_command_test.rb
159
+ - lib/dev_system/dev/controllers/command/bench_command.rb
160
+ - lib/dev_system/dev/controllers/command/bench_command_test.rb
136
161
  - lib/dev_system/dev/controllers/command/echo_command.rb
137
162
  - lib/dev_system/dev/controllers/command/echo_command_test.rb
163
+ - lib/dev_system/dev/controllers/command/generate_command.rb
164
+ - lib/dev_system/dev/controllers/command/generate_command_test.rb
165
+ - lib/dev_system/dev/controllers/command/not_found_command.rb
166
+ - lib/dev_system/dev/controllers/command/not_found_command_test.rb
167
+ - lib/dev_system/dev/controllers/command/terminal_command.rb
168
+ - lib/dev_system/dev/controllers/command/terminal_command_test.rb
138
169
  - lib/dev_system/dev/controllers/command/test_command.rb
139
170
  - lib/dev_system/dev/controllers/command/test_command_test.rb
140
171
  - lib/dev_system/dev/controllers/command/version_command.rb
141
172
  - lib/dev_system/dev/controllers/command/version_command_test.rb
142
173
  - lib/dev_system/dev/controllers/command_test.rb
174
+ - lib/dev_system/dev/controllers/generator.rb
175
+ - lib/dev_system/dev/controllers/generator_dsl_main_part.rb
176
+ - lib/dev_system/dev/controllers/generator_test.rb
177
+ - lib/dev_system/dev/controllers/generators/app_generator.rb
178
+ - lib/dev_system/dev/controllers/generators/app_generator_test.rb
179
+ - lib/dev_system/dev/controllers/generators/generator_generator.rb
180
+ - lib/dev_system/dev/controllers/generators/generator_generator/generator.rb.erb
181
+ - lib/dev_system/dev/controllers/generators/generator_generator/generator_test.rb.erb
182
+ - lib/dev_system/dev/controllers/generators/generator_generator/template.rb.erb
183
+ - lib/dev_system/dev/controllers/generators/generator_generator/template_test.rb.erb
184
+ - lib/dev_system/dev/controllers/generators/generator_generator_test.rb
185
+ - lib/dev_system/dev/controllers/generators/not_found_generator.rb
186
+ - lib/dev_system/dev/controllers/generators/not_found_generator_test.rb
187
+ - lib/dev_system/dev/controllers/shell.rb
188
+ - lib/dev_system/dev/controllers/shell/bin_shell.rb
189
+ - lib/dev_system/dev/controllers/shell/bin_shell_test.rb
190
+ - lib/dev_system/dev/controllers/shell/dir_shell.rb
191
+ - lib/dev_system/dev/controllers/shell/dir_shell_test.rb
192
+ - lib/dev_system/dev/controllers/shell/file_shell.rb
193
+ - lib/dev_system/dev/controllers/shell/file_shell_test.rb
194
+ - lib/dev_system/dev/controllers/shell/text_shell.rb
195
+ - lib/dev_system/dev/controllers/shell/text_shell_test.rb
196
+ - lib/dev_system/dev/controllers/shell_test.rb
197
+ - lib/dev_system/dev/controllers/terminal.rb
198
+ - lib/dev_system/dev/controllers/terminal/irb_terminal.rb
199
+ - lib/dev_system/dev/controllers/terminal/irb_terminal_test.rb
200
+ - lib/dev_system/dev/controllers/terminal/pry_terminal.rb
201
+ - lib/dev_system/dev/controllers/terminal/pry_terminal_test.rb
202
+ - lib/dev_system/dev/controllers/terminal_test.rb
143
203
  - lib/dev_system/dev/dev_box.rb
144
204
  - lib/dev_system/dev/dev_box_test.rb
145
205
  - lib/dev_system/dev/panels/command_panel.rb
@@ -152,6 +212,7 @@ files:
152
212
  - lib/happy_system/happy/happy_box.rb
153
213
  - lib/happy_system/happy/happy_box_test.rb
154
214
  - lib/happy_system/happy/panels/axo_panel.rb
215
+ - lib/lerb.rb
155
216
  - lib/liza.rb
156
217
  - lib/liza/base/box.rb
157
218
  - lib/liza/base/box_test.rb
@@ -159,59 +220,77 @@ files:
159
220
  - lib/liza/base/controller_test.rb
160
221
  - lib/liza/base/panel.rb
161
222
  - lib/liza/base/panel_test.rb
223
+ - lib/liza/base_parts/controller_renderer_part.rb
224
+ - lib/liza/base_parts/controller_renderer_part_test.rb
162
225
  - lib/liza/meta/part.rb
163
226
  - lib/liza/meta/part_extension.rb
164
227
  - lib/liza/meta/part_test.rb
165
228
  - lib/liza/meta/system.rb
166
229
  - lib/liza/meta/system_test.rb
230
+ - lib/liza/ruby_test.rb
231
+ - lib/liza/ruby_tests/module_test.rb
232
+ - lib/liza/ruby_tests/string_test.rb
167
233
  - lib/liza/test/test.rb
168
234
  - lib/liza/test/test_test.rb
235
+ - lib/liza/test_parts/test_assertions_advanced_part.rb
169
236
  - lib/liza/test_parts/test_assertions_part.rb
170
- - lib/liza/test_parts/test_context_part.rb
171
237
  - lib/liza/test_parts/test_dsl_part.rb
238
+ - lib/liza/test_parts/test_log_part.rb
172
239
  - lib/liza/test_parts/test_subject_part.rb
240
+ - lib/liza/test_parts/test_tree_part.rb
173
241
  - lib/liza/unit.rb
242
+ - lib/liza/unit_parts/unit_procedure_part.rb
243
+ - lib/liza/unit_parts/unit_procedure_part_test.rb
174
244
  - lib/liza/unit_test.rb
175
245
  - lib/lizarb.rb
176
246
  - lib/lizarb/ruby/class.rb
247
+ - lib/lizarb/ruby/module.rb
248
+ - lib/lizarb/ruby/proc.rb
177
249
  - lib/lizarb/ruby/string.rb
178
250
  - lib/lizarb/ruby/time.rb
179
251
  - lib/lizarb/version.rb
180
252
  - lib/net_system.rb
181
253
  - lib/net_system/dev/net_command.rb
182
- - lib/net_system/net/controllers/adapter.rb
183
- - lib/net_system/net/controllers/adapter/redis_adapter.rb
184
- - lib/net_system/net/controllers/adapter/redis_adapter_test.rb
185
- - lib/net_system/net/controllers/adapter/sqlite_adapter.rb
186
- - lib/net_system/net/controllers/adapter/sqlite_adapter_test.rb
187
- - lib/net_system/net/controllers/adapter_test.rb
254
+ - lib/net_system/net/controllers/client.rb
255
+ - lib/net_system/net/controllers/client/redis_client.rb
256
+ - lib/net_system/net/controllers/client/redis_client_test.rb
257
+ - lib/net_system/net/controllers/client/sqlite_client.rb
258
+ - lib/net_system/net/controllers/client/sqlite_client_test.rb
259
+ - lib/net_system/net/controllers/client_test.rb
188
260
  - lib/net_system/net/controllers/database.rb
189
261
  - lib/net_system/net/controllers/database/redis_db.rb
190
262
  - lib/net_system/net/controllers/database/redis_db_test.rb
191
263
  - lib/net_system/net/controllers/database/sqlite_db.rb
192
264
  - lib/net_system/net/controllers/database/sqlite_db_test.rb
193
265
  - lib/net_system/net/controllers/database_test.rb
194
- - lib/net_system/net/controllers/model.rb
195
- - lib/net_system/net/controllers/model_test.rb
266
+ - lib/net_system/net/controllers/record.rb
267
+ - lib/net_system/net/controllers/record_test.rb
196
268
  - lib/net_system/net/net_box.rb
197
269
  - lib/net_system/net/net_box_test.rb
198
- - lib/net_system/net/panels/adapter_panel.rb
199
- - lib/net_system/net/panels/adapter_panel_test.rb
270
+ - lib/net_system/net/panels/client_panel.rb
271
+ - lib/net_system/net/panels/client_panel_test.rb
200
272
  - lib/net_system/net/panels/database_panel.rb
201
273
  - lib/net_system/net/panels/database_panel_test.rb
202
274
  - lib/web_system.rb
275
+ - lib/web_system/dev/rack_command.rb
276
+ - lib/web_system/dev/request_command.rb
203
277
  - lib/web_system/dev/web_command.rb
278
+ - lib/web_system/web/controllers/rack.rb
279
+ - lib/web_system/web/controllers/rack_test.rb
204
280
  - lib/web_system/web/controllers/request.rb
205
281
  - lib/web_system/web/controllers/request/client_error_request.rb
206
282
  - lib/web_system/web/controllers/request/not_found_request.rb
207
283
  - lib/web_system/web/controllers/request/server_error_request.rb
208
284
  - lib/web_system/web/controllers/request_test.rb
285
+ - lib/web_system/web/panels/rack_panel.rb
286
+ - lib/web_system/web/panels/rack_panel_test.rb
209
287
  - lib/web_system/web/panels/request_panel.rb
210
288
  - lib/web_system/web/panels/request_panel_test.rb
211
289
  - lib/web_system/web/web_box.rb
212
290
  - lib/web_system/web/web_box_test.rb
213
291
  - lizarb.gemspec
214
292
  - sig/lizarb.rbs
293
+ - tmp/.gitkeep
215
294
  - web_files/favicon.ico
216
295
  - web_files/favicon.svg
217
296
  homepage: http://lizarb.org
@@ -230,14 +309,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
230
309
  requirements:
231
310
  - - ">="
232
311
  - !ruby/object:Gem::Version
233
- version: 3.1.0
312
+ version: 3.2.0
234
313
  required_rubygems_version: !ruby/object:Gem::Requirement
235
314
  requirements:
236
315
  - - ">="
237
316
  - !ruby/object:Gem::Version
238
317
  version: '0'
239
318
  requirements: []
240
- rubygems_version: 3.3.7
319
+ rubygems_version: 3.4.1
241
320
  signing_key:
242
321
  specification_version: 4
243
322
  summary: Application Framework
@@ -1,57 +0,0 @@
1
- class ExampleCommand < AppCommand
2
-
3
- def self.call(args)
4
- log :higher, "Called #{self}.#{__method__} with args #{args}"
5
-
6
- class_helper_method_1(args)
7
- class_helper_method_2(args)
8
- class_helper_method_3(args)
9
-
10
- command = new(args)
11
- command.helper_method_1(args)
12
- command.helper_method_2(args)
13
- command.helper_method_3(args)
14
- end
15
-
16
- #
17
-
18
- def self.class_helper_method_1(args)
19
- log :higher, "Called #{self}.#{__method__} with args #{args}"
20
- 1
21
- end
22
-
23
- def self.class_helper_method_2(args)
24
- log :higher, "Called #{self}.#{__method__} with args #{args}"
25
- 2
26
- end
27
-
28
- def self.class_helper_method_3(args)
29
- log :higher, "Called #{self}.#{__method__} with args #{args}"
30
- 3
31
- end
32
-
33
- #
34
-
35
- def initialize(args)
36
- log :higher, "Called #{self}.#{__method__} with args #{args}"
37
- @init_args = args
38
- end
39
-
40
- #
41
-
42
- def helper_method_1(args)
43
- log :higher, "Called #{self}.#{__method__} (which has @init_args #{@init_args}) with args #{args}"
44
- @init_args[0]
45
- end
46
-
47
- def helper_method_2(args)
48
- log :higher, "Called #{self}.#{__method__} (which has @init_args #{@init_args}) with args #{args}"
49
- @init_args[1]
50
- end
51
-
52
- def helper_method_3(args)
53
- log :higher, "Called #{self}.#{__method__} (which has @init_args #{@init_args}) with args #{args}"
54
- @init_args[2]
55
- end
56
-
57
- end
@@ -1,43 +0,0 @@
1
- class ExampleCommandTest < AppCommandTest
2
-
3
- test :subject_class do
4
- assert subject_class == ExampleCommand
5
- end
6
-
7
- group "class methods" do
8
-
9
- test :class_helper_method_1 do
10
- assert subject_class.class_helper_method_1([]) == 1
11
- end
12
-
13
- test :class_helper_method_2 do
14
- assert subject_class.class_helper_method_2([]) == 2
15
- end
16
-
17
- test :class_helper_method_3 do
18
- assert subject_class.class_helper_method_3([]) == 3
19
- end
20
-
21
- end
22
-
23
- group "instance methods" do
24
-
25
- before do
26
- @subject = subject_class.new([1, 2, 3])
27
- end
28
-
29
- test :helper_method_1 do
30
- assert @subject.helper_method_1([]) == 1
31
- end
32
-
33
- test :helper_method_2 do
34
- assert @subject.helper_method_2([]) == 2
35
- end
36
-
37
- test :helper_method_3 do
38
- assert @subject.helper_method_3([]) == 3
39
- end
40
-
41
- end
42
-
43
- end
@@ -1,32 +0,0 @@
1
- class MacroChildCommand < MacroParentCommand
2
-
3
- class_macro_method_1 :important_thing
4
- class_macro_method_2 :other_thing
5
- class_macro_method_3 :other_important_thing
6
- class_macro_method_4 :ruby_is_awesome
7
-
8
- #
9
-
10
- def call(args)
11
- log :higher, "Called #{self}.#{__method__} (which has @init_args #{@init_args}) with args #{args}"
12
-
13
- if @@class_macro_3
14
- @result << :YES_from_instance_call
15
- else
16
- @result << :NO_from_instance_call
17
- end
18
-
19
- @result << helper_method(args)
20
- end
21
-
22
- def helper_method(args)
23
- log :higher, "Called #{self}.#{__method__} (which has @init_args #{@init_args}) with args #{args}"
24
-
25
- if @@class_macro_4
26
- :Yes_from_helper_method
27
- else
28
- :No_from_helper_method
29
- end
30
- end
31
-
32
- end
@@ -1,7 +0,0 @@
1
- class MacroChildCommandTest < AppCommandTest
2
-
3
- test :subject_class do
4
- assert subject_class == MacroChildCommand
5
- end
6
-
7
- end
@@ -1,70 +0,0 @@
1
- class MacroParentCommand < AppCommand
2
-
3
- def self.class_macro_method_1(arg)
4
- log :higher, "Called #{self}.#{__method__} with arg #{arg}"
5
- @@class_macro_1 = arg
6
- end
7
-
8
- def self.class_macro_method_2(arg)
9
- log :higher, "Called #{self}.#{__method__} with arg #{arg}"
10
- @@class_macro_2 = arg
11
- end
12
-
13
- def self.class_macro_method_3(arg)
14
- log :higher, "Called #{self}.#{__method__} with arg #{arg}"
15
- @@class_macro_3 = arg
16
- end
17
-
18
- def self.class_macro_method_4(arg)
19
- log :higher, "Called #{self}.#{__method__} with arg #{arg}"
20
- @@class_macro_4 = arg
21
- end
22
-
23
- #
24
-
25
- def self.call(args)
26
- log :higher, "Called #{self}.#{__method__} with args #{args}"
27
-
28
- if @@class_macro_1
29
- args << :yes_from_class_call
30
- else
31
- args << :no_from_class_call
32
- end
33
-
34
- command = new(args)
35
- result = command.call(args)
36
-
37
- puts <<-OUTPUT
38
-
39
- self: #{self}
40
- args: #{args}
41
- command: #{command}
42
- result: #{result}
43
-
44
- OUTPUT
45
- end
46
-
47
- #
48
-
49
- attr_reader :result
50
-
51
- def initialize(args)
52
- log :higher, "Called #{self}.#{__method__} with args #{args}"
53
- @init_args = args
54
-
55
- @result = [args]
56
-
57
- if @@class_macro_2
58
- @result << :yes_from_initialize
59
- else
60
- @result << :no_from_initialize
61
- end
62
- end
63
-
64
- #
65
-
66
- def call(args)
67
- raise NotImplementedError, "implement this on MacroChildCommand"
68
- end
69
-
70
- end