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
@@ -1,7 +0,0 @@
1
- class MacroParentCommandTest < AppCommandTest
2
-
3
- test :subject_class do
4
- assert subject_class == MacroParentCommand
5
- end
6
-
7
- end
@@ -1,7 +0,0 @@
1
- class MyCommand < AppCommand
2
-
3
- def self.call args
4
- log :higher, "Called #{self}.#{__method__} with args #{args}"
5
- end
6
-
7
- end
@@ -1,7 +0,0 @@
1
- class MyCommandTest < AppCommandTest
2
-
3
- test :subject_class do
4
- assert subject_class == MyCommand
5
- end
6
-
7
- end
@@ -1,4 +0,0 @@
1
- class PostModel < AppModel
2
- set :table, :posts
3
-
4
- end
@@ -1,4 +0,0 @@
1
- class UserModel < AppModel
2
- set :table, :users
3
-
4
- end
@@ -1,81 +0,0 @@
1
- module Liza
2
- class TestContextPart < Part
3
-
4
- insertion do
5
- def self.context
6
- @context ||= Liza::TestContextPart::Extension.new self
7
- end
8
-
9
- def self.before &block
10
- block_given? || raise(ArgumentError, "No block given")
11
-
12
- context.add_before block
13
- end
14
-
15
- def self.after &block
16
- block_given? || raise(ArgumentError, "No block given")
17
-
18
- context.add_after block
19
- end
20
-
21
- def self.group *_words, &block
22
- block_given? || raise(ArgumentError, "No block given")
23
-
24
- context.open_group
25
- instance_exec &block
26
- context.close_group
27
- end
28
- end
29
-
30
- extension do
31
- # group
32
-
33
- def open_group
34
- befores.push befores.last.dup
35
- afters.push afters.last.dup
36
- end
37
-
38
- def close_group
39
- befores.pop
40
- afters.pop
41
- end
42
-
43
- # before
44
-
45
- def befores
46
- @befores ||= _befores_from_superclass + [[]]
47
- end
48
-
49
- def add_before block
50
- befores.last.push block
51
- end
52
-
53
- def _befores_from_superclass
54
- if solder.superclass.respond_to? :context
55
- solder.superclass.context.befores.dup
56
- else
57
- []
58
- end
59
- end
60
-
61
- # after
62
-
63
- def afters
64
- @afters ||= _afters_from_superclass + [[]]
65
- end
66
-
67
- def add_after block
68
- afters.last.push block
69
- end
70
-
71
- def _afters_from_superclass
72
- if solder.superclass.respond_to? :context
73
- solder.superclass.context.afters.dup
74
- else
75
- []
76
- end
77
- end
78
- end
79
-
80
- end
81
- end
@@ -1,5 +0,0 @@
1
- class NetSystem
2
- class Adapter < Liza::Controller
3
-
4
- end
5
- end
@@ -1,31 +0,0 @@
1
- class NetSystem
2
- class Model < Liza::Controller
3
-
4
- def self.inherited sub
5
- super
6
-
7
- return if sub.name.nil?
8
- return if sub.name.end_with? "Model"
9
- raise "please rename #{sub.name} to #{sub.name}Model"
10
- end
11
-
12
- def self.db database_id = nil
13
- if database_id.nil?
14
- db = get :db
15
- if db
16
- NetBox.databases.get db
17
- else
18
- raise "please set a db to model #{self}"
19
- end
20
- else
21
- valid = NetBox.databases.settings.keys
22
- if valid.include? database_id
23
- set :db, database_id
24
- else
25
- raise "invalid db, valid options are #{valid}"
26
- end
27
- end
28
- end
29
-
30
- end
31
- end
@@ -1,5 +0,0 @@
1
- class NetSystem
2
- class AdapterPanel < Liza::Panel
3
-
4
- end
5
- end