lizarb 1.0.3 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +34 -7
- data/Gemfile.lock +179 -18
- data/README.md +53 -9
- data/Rakefile +38 -0
- data/app/dev/commands/color_command.rb +29 -0
- data/app/dev/commands/color_command_test.rb +10 -0
- data/app/dev/commands/stick_command.rb +102 -0
- data/app/dev/commands/stick_command_test.rb +19 -0
- data/app/dev_box.rb +54 -20
- data/app/happy_box.rb +4 -3
- data/app/net/databases/redis_db.rb +1 -1
- data/app/net/databases/redis_db_test.rb +5 -5
- data/app/net/databases/sqlite_db.rb +1 -1
- data/app/net/databases/sqlite_db_test.rb +5 -5
- data/app/net/records/app_record.rb +1 -1
- data/app/net/records/app_record_test.rb +1 -1
- data/app/net/records/post_record_test.rb +1 -1
- data/app/net/records/user_record_test.rb +1 -1
- data/app/net_box.rb +29 -6
- data/app/web/requests/app_request.rb +1 -1
- data/app/web/requests/app_request_test.rb +1 -1
- data/app/web/requests/foo_request.rb +26 -0
- data/app/web/requests/foo_request_test.rb +7 -0
- data/app/web_box.rb +17 -9
- data/app.rb +41 -10
- data/{exe/Gemfile → app_global.gemfile.rb} +2 -0
- data/app_global.gemfile.rb.lock +41 -0
- data/app_global.rb +5 -0
- data/{app → examples/bench/app}/dev/benches/loops_bench.rb +11 -3
- data/examples/bench/app/dev/benches/loops_bench_test.rb +11 -0
- data/examples/bench/app/dev/benches/objects_bench.rb +48 -0
- data/examples/bench/app/dev/benches/objects_bench_test.rb +11 -0
- data/examples/bench/app/dev/benches/sorted_bench.rb +74 -0
- data/examples/bench/app/dev/benches/sorted_bench_test.rb +11 -0
- data/examples/bench/app/dev/benches/variables_bench.rb +61 -0
- data/examples/bench/app/dev/benches/variables_bench_test.rb +11 -0
- data/examples/client/app/net/clients/news_client.rb +42 -0
- data/examples/client/app/net/clients/news_client_test.rb +24 -0
- data/{app → examples/command/app}/dev/commands/calculator_command.rb +2 -2
- data/{app → examples/command/app}/dev/commands/calculator_command_test.rb +1 -2
- data/{app → examples/command/app}/dev/commands/circle_command.rb +2 -2
- data/{app → examples/command/app}/dev/commands/circle_command_test.rb +1 -2
- data/{app → examples/command/app}/dev/commands/narrative_method_command.rb +8 -10
- data/{app → examples/command/app}/dev/commands/narrative_method_command_test.rb +2 -3
- data/{app → examples/command/app}/dev/commands/quadratic_command.rb +2 -2
- data/{app → examples/command/app}/dev/commands/quadratic_command_test.rb +1 -2
- data/examples/command/app/dev_box.rb +3 -0
- data/examples/log/app/dev/logs/logger_log.rb +8 -0
- data/examples/log/app/dev/logs/logger_log_test.rb +16 -0
- data/examples/new/app/dev_box.rb +67 -0
- data/examples/new/app.rb +41 -0
- data/examples/shell/app/dev/shells/bash_adapter_shell.rb +25 -0
- data/examples/shell/app/dev/shells/bash_adapter_shell_test.rb +23 -0
- data/examples/shell/app/dev/shells/business_logic_shell.rb +42 -0
- data/examples/shell/app/dev/shells/business_logic_shell_test.rb +39 -0
- data/examples/shell/app/dev/shells/gem_adapter_shell.rb +33 -0
- data/examples/shell/app/dev/shells/gem_adapter_shell_test.rb +23 -0
- data/exe/liza +6 -1
- data/exe/lizarb +9 -1
- data/lib/app.rb +74 -145
- data/lib/art_system/art_box.rb +5 -0
- data/lib/art_system/art_box_test.rb +8 -0
- data/lib/art_system.rb +8 -0
- data/lib/crypto_system/crypto_box.rb +5 -0
- data/lib/crypto_system/crypto_box_test.rb +8 -0
- data/lib/crypto_system.rb +8 -0
- data/lib/deep_system/deep_box.rb +5 -0
- data/lib/deep_system/deep_box_test.rb +8 -0
- data/lib/deep_system.rb +8 -0
- data/lib/desk_system/commands/glimmer_command.rb +26 -0
- data/lib/desk_system/commands/glimmer_command_test.rb +10 -0
- data/lib/desk_system/desk_box.rb +5 -0
- data/lib/desk_system/desk_box_test.rb +8 -0
- data/lib/desk_system.rb +8 -0
- data/lib/dev_system/{dev/controllers/command → commands}/test_command.rb +37 -9
- data/lib/dev_system/{dev/controllers/command → commands}/test_command_test.rb +1 -2
- data/lib/dev_system/dev_box.rb +79 -0
- data/lib/dev_system/dev_box_test.rb +33 -0
- data/lib/dev_system/generators/env_generator.rb +87 -0
- data/lib/dev_system/generators/env_generator_test.rb +11 -0
- data/lib/dev_system/generators/gemfile_generator.rb +47 -0
- data/lib/dev_system/generators/gemfile_generator_test.rb +11 -0
- data/lib/dev_system/generators/system_generator.rb +70 -0
- data/lib/dev_system/generators/system_generator_test.rb +11 -0
- data/lib/dev_system/sub/bench/bench.rb +7 -0
- data/lib/dev_system/{dev/panels → sub/bench}/bench_panel_test.rb +6 -2
- data/lib/dev_system/sub/bench/bench_test.rb +24 -0
- data/lib/dev_system/sub/bench/benches/not_found_bench.rb +33 -0
- data/lib/dev_system/{dev/controllers/bench → sub/bench/benches}/not_found_bench_test.rb +1 -2
- data/lib/dev_system/{dev/controllers/command → sub/bench/commands}/bench_command.rb +2 -7
- data/lib/dev_system/{dev/controllers/command → sub/bench/commands}/bench_command_test.rb +1 -2
- data/lib/dev_system/sub/bench/generators/bench_generator.rb +70 -0
- data/lib/dev_system/sub/bench/generators/bench_generator_test.rb +10 -0
- data/lib/dev_system/sub/command/command.rb +28 -0
- data/lib/dev_system/sub/command/command_panel.rb +151 -0
- data/lib/dev_system/sub/command/command_panel_test.rb +78 -0
- data/lib/dev_system/{dev/controllers → sub/command}/command_test.rb +6 -2
- data/lib/dev_system/sub/command/commands/base_command.rb +48 -0
- data/lib/dev_system/sub/command/commands/base_command_test.rb +11 -0
- data/lib/dev_system/{dev/controllers/terminal/irb_terminal.rb → sub/command/commands/irb_command.rb} +4 -2
- data/lib/dev_system/sub/command/commands/irb_command_test.rb +11 -0
- data/lib/dev_system/sub/command/commands/not_found_command.rb +156 -0
- data/lib/dev_system/sub/command/commands/not_found_command_test.rb +11 -0
- data/lib/dev_system/sub/command/commands/pry_command.rb +10 -0
- data/lib/dev_system/sub/command/commands/pry_command_test.rb +11 -0
- data/lib/dev_system/sub/command/commands/simple_command.rb +143 -0
- data/lib/dev_system/sub/command/commands/simple_command_test.rb +11 -0
- data/lib/dev_system/sub/command/generators/command_generator.rb +90 -0
- data/lib/dev_system/sub/command/generators/command_generator_test.rb +11 -0
- data/lib/dev_system/sub/command/input_commands/highline_input_command.rb +17 -0
- data/lib/dev_system/sub/command/input_commands/highline_input_command_test.rb +19 -0
- data/lib/dev_system/sub/command/input_commands/input_command.rb +20 -0
- data/lib/dev_system/sub/command/input_commands/input_command_test.rb +19 -0
- data/lib/dev_system/sub/command/input_commands/tty_input_command.rb +55 -0
- data/lib/dev_system/sub/command/input_commands/tty_input_command_test.rb +19 -0
- data/lib/dev_system/sub/generator/commands/generate_command.rb +9 -0
- data/lib/dev_system/sub/generator/commands/generate_command_test.rb +11 -0
- data/lib/dev_system/sub/generator/commands/new_command.rb +10 -0
- data/lib/dev_system/sub/generator/commands/new_command_test.rb +7 -0
- data/lib/dev_system/sub/generator/generator.rb +19 -0
- data/lib/dev_system/sub/generator/generator_panel.rb +98 -0
- data/lib/dev_system/sub/generator/generator_panel_test.rb +79 -0
- data/lib/dev_system/{dev/controllers → sub/generator}/generator_test.rb +6 -2
- data/lib/dev_system/sub/generator/generators/base_generator.rb +64 -0
- data/lib/dev_system/sub/generator/generators/base_generator_test.rb +11 -0
- data/lib/dev_system/sub/generator/generators/generator_generator.rb +71 -0
- data/lib/dev_system/sub/generator/generators/generator_generator_test.rb +11 -0
- data/lib/dev_system/sub/generator/generators/new_generator.rb +74 -0
- data/lib/dev_system/sub/generator/generators/new_generator_test.rb +11 -0
- data/lib/dev_system/sub/generator/generators/not_found_generator.rb +155 -0
- data/lib/dev_system/sub/generator/generators/not_found_generator_test.rb +11 -0
- data/lib/dev_system/sub/generator/generators/simple_generator.rb +257 -0
- data/lib/dev_system/sub/generator/generators/simple_generator_test.rb +38 -0
- data/lib/dev_system/sub/log/commands/log_command.rb +11 -0
- data/lib/dev_system/sub/log/commands/log_command_test.rb +11 -0
- data/lib/dev_system/sub/log/generators/log_generator.rb +54 -0
- data/lib/dev_system/sub/log/generators/log_generator_test.rb +10 -0
- data/lib/dev_system/sub/log/log.rb +3 -0
- data/lib/dev_system/sub/log/log_panel.rb +47 -0
- data/lib/dev_system/sub/log/log_panel_test.rb +50 -0
- data/lib/dev_system/sub/log/log_test.rb +16 -0
- data/lib/dev_system/sub/log/logs/output_log.rb +74 -0
- data/lib/dev_system/sub/log/logs/output_log_test.rb +47 -0
- data/lib/dev_system/sub/log/logs/stick_log.rb +79 -0
- data/lib/dev_system/sub/log/logs/stick_log_test.rb +88 -0
- data/lib/dev_system/sub/shell/commands/convert_command.rb +27 -0
- data/lib/dev_system/sub/shell/commands/convert_command_test.rb +10 -0
- data/lib/dev_system/sub/shell/commands/format_command.rb +25 -0
- data/lib/dev_system/sub/shell/commands/format_command_test.rb +10 -0
- data/lib/dev_system/sub/shell/commands/loc_command.rb +211 -0
- data/lib/dev_system/sub/shell/commands/loc_command_test.rb +10 -0
- data/lib/dev_system/sub/shell/commands/shell_command.rb +45 -0
- data/lib/dev_system/sub/shell/commands/shell_command_test.rb +11 -0
- data/lib/dev_system/sub/shell/converter_shells/coffee_converter_shell.rb +21 -0
- data/lib/dev_system/sub/shell/converter_shells/coffee_converter_shell_test.rb +41 -0
- data/lib/dev_system/sub/shell/converter_shells/converter_shell.rb +13 -0
- data/lib/dev_system/sub/shell/converter_shells/converter_shell_test.rb +19 -0
- data/lib/dev_system/sub/shell/converter_shells/haml_converter_shell.rb +30 -0
- data/lib/dev_system/sub/shell/converter_shells/haml_converter_shell_test.rb +34 -0
- data/lib/dev_system/sub/shell/converter_shells/md_converter_shell.rb +21 -0
- data/lib/dev_system/sub/shell/converter_shells/md_converter_shell_test.rb +38 -0
- data/lib/dev_system/sub/shell/converter_shells/scss_converter_shell.rb +59 -0
- data/lib/dev_system/sub/shell/converter_shells/scss_converter_shell_test.rb +59 -0
- data/lib/dev_system/sub/shell/formatter_shells/formatter_shell.rb +13 -0
- data/lib/dev_system/sub/shell/formatter_shells/formatter_shell_test.rb +19 -0
- data/lib/dev_system/sub/shell/formatter_shells/html_formatter_shell.rb +20 -0
- data/lib/dev_system/sub/shell/formatter_shells/html_formatter_shell_test.rb +51 -0
- data/lib/dev_system/sub/shell/generators/shell_generator.rb +68 -0
- data/lib/dev_system/sub/shell/generators/shell_generator_test.rb +10 -0
- data/lib/dev_system/{dev/controllers → sub/shell}/shell.rb +22 -0
- data/lib/dev_system/sub/shell/shell_panel.rb +98 -0
- data/lib/dev_system/sub/shell/shell_panel_test.rb +18 -0
- data/lib/dev_system/{dev/controllers → sub/shell}/shell_test.rb +31 -2
- data/lib/dev_system/sub/shell/shells/app_shell.rb +185 -0
- data/lib/dev_system/sub/shell/shells/app_shell_test.rb +26 -0
- data/lib/dev_system/{dev/controllers/shell → sub/shell/shells}/bin_shell_test.rb +1 -2
- data/lib/dev_system/sub/shell/shells/color_shell.rb +389 -0
- data/lib/dev_system/sub/shell/shells/color_shell_test.rb +27 -0
- data/lib/dev_system/sub/shell/shells/controller_shell.rb +20 -0
- data/lib/dev_system/sub/shell/shells/controller_shell_test.rb +16 -0
- data/lib/dev_system/sub/shell/shells/dir_shell.rb +27 -0
- data/lib/dev_system/{dev/controllers/shell → sub/shell/shells}/dir_shell_test.rb +1 -5
- data/lib/dev_system/{dev/controllers/shell → sub/shell/shells}/file_shell.rb +4 -4
- data/lib/dev_system/{dev/controllers/shell → sub/shell/shells}/file_shell_test.rb +1 -2
- data/lib/dev_system/sub/shell/shells/gem_shell.rb +21 -0
- data/lib/dev_system/sub/shell/shells/gem_shell_test.rb +28 -0
- data/lib/dev_system/sub/shell/shells/kernel_shell.rb +22 -0
- data/lib/dev_system/sub/shell/shells/kernel_shell_test.rb +10 -0
- data/lib/dev_system/sub/shell/shells/line_diff_shell.rb +26 -0
- data/lib/dev_system/sub/shell/shells/line_diff_shell_test.rb +11 -0
- data/lib/dev_system/sub/shell/shells/line_shell.rb +56 -0
- data/lib/dev_system/sub/shell/shells/line_shell_test.rb +70 -0
- data/lib/dev_system/sub/shell/shells/method_shell.rb +52 -0
- data/lib/dev_system/sub/shell/shells/method_shell_test.rb +34 -0
- data/lib/dev_system/sub/shell/shells/text_file_shell.rb +14 -0
- data/lib/dev_system/sub/shell/shells/text_file_shell_test.rb +11 -0
- data/lib/dev_system/sub/shell/shells/text_shell.rb +65 -0
- data/lib/dev_system/{dev/controllers/shell → sub/shell/shells}/text_shell_test.rb +1 -2
- data/lib/dev_system.rb +8 -2
- data/lib/happy_system/happy_box.rb +9 -0
- data/lib/happy_system/happy_box_test.rb +24 -0
- data/lib/happy_system/sub/axo/axo.rb +10 -0
- data/lib/happy_system/sub/axo/axo_panel.rb +9 -0
- data/lib/happy_system/sub/axo/axo_panel_test.rb +16 -0
- data/lib/happy_system/sub/axo/axo_test.rb +16 -0
- data/lib/happy_system/sub/axo/commands/axo_command.rb +40 -0
- data/lib/happy_system/sub/axo/commands/axo_command_test.rb +8 -0
- data/lib/happy_system/sub/axo/generators/axo_generator.rb +79 -0
- data/lib/happy_system/sub/axo/generators/axo_generator_test.rb +11 -0
- data/lib/happy_system.rb +4 -2
- data/lib/lab_system/clients/kroki_client.rb +134 -0
- data/lib/lab_system/clients/kroki_client_test.rb +32 -0
- data/lib/lab_system/clients/liza_kroki_client.rb +176 -0
- data/lib/lab_system/clients/liza_kroki_client_test.rb +32 -0
- data/lib/lab_system/commands/docker_command.rb +61 -0
- data/lib/lab_system/commands/docker_command_test.rb +11 -0
- data/lib/lab_system/lab_box.rb +5 -0
- data/lib/lab_system/lab_box_test.rb +8 -0
- data/lib/lab_system/requests/kroki_request.rb +182 -0
- data/lib/lab_system/requests/kroki_request_test.rb +11 -0
- data/lib/lab_system/shells/docker_shell.rb +60 -0
- data/lib/lab_system/shells/docker_shell_test.rb +61 -0
- data/lib/lab_system/shells/kroki_docker_shell.rb +20 -0
- data/lib/lab_system/shells/kroki_docker_shell_test.rb +11 -0
- data/lib/lab_system.rb +8 -0
- data/lib/lerb.rb +95 -49
- data/lib/liza/base/controller.rb +14 -15
- data/lib/liza/base/controller_test.rb +28 -2
- data/lib/liza/base/panel.rb +64 -24
- data/lib/liza/base/panel_test.rb +168 -3
- data/lib/liza/base_parts/controller_subsystem_part.rb +93 -0
- data/lib/liza/base_parts/panel_rescuer_part.rb +129 -0
- data/lib/liza/meta/box.rb +24 -0
- data/lib/liza/meta/box_test.rb +20 -0
- data/lib/liza/meta/part_test.rb +6 -1
- data/lib/liza/meta/system.rb +50 -7
- data/lib/liza/meta/system_test.rb +6 -2
- data/lib/liza/ruby_tests/app_test.rb +39 -0
- data/lib/liza/ruby_tests/class_test.rb +20 -0
- data/lib/liza/ruby_tests/module_test.rb +4 -4
- data/lib/liza/{ruby_test.rb → ruby_tests/object_test.rb} +1 -1
- data/lib/liza/ruby_tests/string_test.rb +3 -1
- data/lib/liza/{test → safety}/test.rb +9 -0
- data/lib/liza/{test → safety}/test_test.rb +44 -7
- data/lib/liza/{test_parts → safety_parts}/test_assertions_advanced_part.rb +1 -1
- data/lib/liza/{test_parts → safety_parts}/test_assertions_part.rb +1 -1
- data/lib/liza/{test_parts → safety_parts}/test_dsl_part.rb +3 -3
- data/lib/liza/{test_parts → safety_parts}/test_log_part.rb +20 -0
- data/lib/liza/{test_parts → safety_parts}/test_subject_part.rb +10 -0
- data/lib/liza/safety_parts/test_tree_part.rb +87 -0
- data/lib/liza/unit.rb +64 -120
- data/lib/liza/unit_parts/unit_classes_part.rb +37 -0
- data/lib/liza/unit_parts/unit_classes_part_test.rb +3 -0
- data/lib/liza/unit_parts/unit_logging_part.rb +139 -0
- data/lib/liza/unit_parts/unit_logging_part_test.rb +3 -0
- data/lib/liza/unit_parts/unit_methods_part.rb +35 -0
- data/lib/liza/unit_parts/unit_methods_part_test.rb +3 -0
- data/lib/liza/unit_parts/unit_procedure_part.rb +2 -2
- data/lib/liza/unit_parts/unit_procedure_part_test.rb +9 -9
- data/lib/liza/unit_parts/unit_renderer_part.rb +171 -0
- data/lib/liza/unit_parts/unit_renderer_part_test.rb +15 -0
- data/lib/liza/unit_parts/unit_settings_part.rb +84 -0
- data/lib/liza/unit_parts/unit_settings_part_test.rb +3 -0
- data/lib/liza/unit_test.rb +114 -5
- data/lib/liza.rb +11 -2
- data/lib/lizarb/ruby/class.rb +9 -1
- data/lib/lizarb/ruby/module.rb +1 -1
- data/lib/lizarb/ruby/string.rb +3 -1
- data/lib/lizarb/version.rb +1 -1
- data/lib/lizarb.rb +404 -29
- data/lib/micro_system/micro_box.rb +5 -0
- data/lib/micro_system/micro_box_test.rb +8 -0
- data/lib/micro_system.rb +8 -0
- data/lib/net_system/net_box.rb +21 -0
- data/lib/net_system/{net/net_box_test.rb → net_box_test.rb} +1 -2
- data/lib/net_system/{net/panels → sub/client}/client_panel_test.rb +1 -2
- data/lib/net_system/{net/controllers → sub/client}/client_test.rb +1 -2
- data/lib/net_system/sub/client/generators/client_generator.rb +88 -0
- data/lib/net_system/sub/client/generators/client_generator_test.rb +10 -0
- data/lib/net_system/sub/database/clients/mongo_client.rb +33 -0
- data/lib/net_system/sub/database/clients/mongo_client_test.rb +20 -0
- data/lib/net_system/sub/database/clients/mysql_client.rb +29 -0
- data/lib/net_system/sub/database/clients/mysql_client_test.rb +23 -0
- data/lib/net_system/sub/database/clients/pgsql_client.rb +29 -0
- data/lib/net_system/sub/database/clients/pgsql_client_test.rb +25 -0
- data/lib/net_system/{net/controllers/client → sub/database/clients}/redis_client.rb +5 -2
- data/lib/net_system/{net/controllers/client → sub/database/clients}/redis_client_test.rb +2 -2
- data/lib/net_system/{net/controllers/client → sub/database/clients}/sqlite_client.rb +5 -2
- data/lib/net_system/{net/controllers/client → sub/database/clients}/sqlite_client_test.rb +2 -2
- data/lib/net_system/sub/database/commands/database_command.rb +32 -0
- data/lib/net_system/sub/database/commands/database_command_test.rb +11 -0
- data/lib/net_system/{net/panels → sub/database}/database_panel_test.rb +1 -2
- data/lib/net_system/{net/controllers → sub/database}/database_test.rb +1 -2
- data/lib/net_system/sub/database/databases/mongo_db.rb +8 -0
- data/lib/net_system/sub/database/databases/mongo_db_test.rb +21 -0
- data/lib/net_system/sub/database/databases/mysql_db.rb +8 -0
- data/lib/net_system/sub/database/databases/mysql_db_test.rb +21 -0
- data/lib/net_system/sub/database/databases/pgsql_db.rb +8 -0
- data/lib/net_system/sub/database/databases/pgsql_db_test.rb +21 -0
- data/lib/net_system/{net/controllers/database → sub/database/databases}/redis_db_test.rb +1 -1
- data/lib/net_system/{net/controllers/database → sub/database/databases}/sqlite_db_test.rb +1 -1
- data/lib/net_system/sub/record/generators/record_generator.rb +33 -0
- data/lib/net_system/sub/record/generators/record_generator_test.rb +11 -0
- data/lib/net_system/sub/record/record_panel.rb +3 -0
- data/lib/net_system/sub/record/record_panel_test.rb +11 -0
- data/lib/net_system/{net/controllers → sub/record}/record_test.rb +1 -2
- data/lib/net_system.rb +8 -1
- data/lib/web_system/sub/rack/commands/rack_command.rb +30 -0
- data/lib/web_system/sub/rack/commands/rack_command_test.rb +11 -0
- data/lib/web_system/sub/rack/middle_racks/first_middle_rack.rb +8 -0
- data/lib/web_system/sub/rack/middle_racks/first_middle_rack_test.rb +11 -0
- data/lib/web_system/sub/rack/middle_racks/last_middle_rack.rb +3 -0
- data/lib/web_system/sub/rack/middle_racks/last_middle_rack_test.rb +11 -0
- data/lib/web_system/sub/rack/middle_racks/middle_rack.rb +18 -0
- data/lib/web_system/sub/rack/middle_racks/middle_rack_test.rb +11 -0
- data/lib/web_system/sub/rack/middle_racks/zeitwerk_middle_rack.rb +11 -0
- data/lib/web_system/sub/rack/middle_racks/zeitwerk_middle_rack_test.rb +11 -0
- data/lib/web_system/sub/rack/rack_panel.rb +52 -0
- data/lib/web_system/{web/panels → sub/rack}/rack_panel_test.rb +1 -2
- data/lib/web_system/{web/controllers → sub/rack}/rack_test.rb +1 -2
- data/lib/web_system/sub/rack/server_racks/agoo_server_rack.rb +53 -0
- data/lib/web_system/sub/rack/server_racks/agoo_server_rack_test.rb +11 -0
- data/lib/web_system/sub/rack/server_racks/falcon_server_rack.rb +46 -0
- data/lib/web_system/sub/rack/server_racks/falcon_server_rack_test.rb +11 -0
- data/lib/web_system/sub/rack/server_racks/iodine_server_rack.rb +47 -0
- data/lib/web_system/sub/rack/server_racks/iodine_server_rack_test.rb +11 -0
- data/lib/web_system/sub/rack/server_racks/puma_server_rack.rb +48 -0
- data/lib/web_system/sub/rack/server_racks/puma_server_rack_test.rb +11 -0
- data/lib/web_system/sub/rack/server_racks/server_rack.rb +12 -0
- data/lib/web_system/sub/rack/server_racks/server_rack_test.rb +11 -0
- data/lib/web_system/sub/rack/server_racks/thin_server_rack.rb +85 -0
- data/lib/web_system/sub/rack/server_racks/thin_server_rack_test.rb +11 -0
- data/lib/web_system/sub/request/commands/request_command.rb +125 -0
- data/lib/web_system/sub/request/commands/request_command_test.rb +11 -0
- data/lib/web_system/sub/request/generators/request_generator.rb +96 -0
- data/lib/web_system/sub/request/generators/request_generator_test.rb +11 -0
- data/lib/web_system/sub/request/request_panel.rb +69 -0
- data/lib/web_system/sub/request/request_panel_test.rb +54 -0
- data/lib/web_system/{web/controllers → sub/request}/request_test.rb +1 -2
- data/lib/web_system/sub/request/requests/simple_request.rb +95 -0
- data/lib/web_system/sub/request/requests/simple_request_test.rb +11 -0
- data/lib/web_system/sub/request/router_requests/router_request.rb +7 -0
- data/lib/web_system/sub/request/router_requests/router_request_test.rb +11 -0
- data/lib/web_system/sub/request/router_requests/simple_router_request.rb +24 -0
- data/lib/web_system/sub/request/router_requests/simple_router_request_test.rb +11 -0
- data/lib/web_system/web_box.rb +17 -0
- data/lib/web_system/{web/web_box_test.rb → web_box_test.rb} +1 -2
- data/lib/web_system.rb +9 -3
- data/lib/work_system/work_box.rb +5 -0
- data/lib/work_system/work_box_test.rb +8 -0
- data/lib/work_system.rb +8 -0
- data/lizarb.gemspec +14 -8
- metadata +375 -168
- data/.ruby-version +0 -1
- data/app/dev/benches/app_bench.rb +0 -5
- data/app/dev/benches/app_bench_test.rb +0 -7
- data/app/dev/benches/loops_bench_test.rb +0 -11
- data/app/dev/commands/app_command.rb +0 -5
- data/app/dev/commands/app_command_test.rb +0 -7
- data/app/dev/commands/new_command.rb +0 -9
- data/app/dev/commands/new_command_test.rb +0 -7
- data/app/dev/generators/bench_generator/bench.rb.erb +0 -24
- data/app/dev/generators/bench_generator/bench_test.rb.erb +0 -12
- data/app/dev/generators/bench_generator.rb +0 -18
- data/app/dev/generators/bench_generator_test.rb +0 -12
- data/app/dev/generators/command_generator/command.rb.erb +0 -26
- data/app/dev/generators/command_generator/command_test.rb.erb +0 -12
- data/app/dev/generators/command_generator.rb +0 -18
- data/app/dev/generators/command_generator_test.rb +0 -12
- data/app/dev/generators/record_generator.rb +0 -46
- data/app/dev/generators/record_generator_test.rb +0 -12
- data/app/dev/generators/request_generator.rb +0 -63
- data/app/dev/generators/request_generator_test.rb +0 -12
- data/app/happy/axos/axo.rb +0 -50
- data/exe/Gemfile.lock +0 -13
- data/exe/lrb +0 -3
- data/lib/dev_system/dev/controllers/bench/not_found_bench.rb +0 -27
- data/lib/dev_system/dev/controllers/bench.rb +0 -9
- data/lib/dev_system/dev/controllers/bench_dsl_main_part.rb +0 -58
- data/lib/dev_system/dev/controllers/bench_test.rb +0 -12
- data/lib/dev_system/dev/controllers/command/echo_command.rb +0 -9
- data/lib/dev_system/dev/controllers/command/echo_command_test.rb +0 -12
- data/lib/dev_system/dev/controllers/command/generate_command.rb +0 -33
- data/lib/dev_system/dev/controllers/command/generate_command_test.rb +0 -12
- data/lib/dev_system/dev/controllers/command/not_found_command.rb +0 -27
- data/lib/dev_system/dev/controllers/command/not_found_command_test.rb +0 -12
- data/lib/dev_system/dev/controllers/command/terminal_command.rb +0 -22
- data/lib/dev_system/dev/controllers/command/terminal_command_test.rb +0 -12
- data/lib/dev_system/dev/controllers/command/version_command.rb +0 -7
- data/lib/dev_system/dev/controllers/command/version_command_test.rb +0 -12
- data/lib/dev_system/dev/controllers/command.rb +0 -17
- data/lib/dev_system/dev/controllers/generator.rb +0 -9
- data/lib/dev_system/dev/controllers/generator_dsl_main_part.rb +0 -52
- data/lib/dev_system/dev/controllers/generators/app_generator.rb +0 -146
- data/lib/dev_system/dev/controllers/generators/app_generator_test.rb +0 -12
- data/lib/dev_system/dev/controllers/generators/generator_generator/generator.rb.erb +0 -18
- data/lib/dev_system/dev/controllers/generators/generator_generator/generator_test.rb.erb +0 -12
- data/lib/dev_system/dev/controllers/generators/generator_generator/template.rb.erb +0 -9
- data/lib/dev_system/dev/controllers/generators/generator_generator/template_test.rb.erb +0 -12
- data/lib/dev_system/dev/controllers/generators/generator_generator.rb +0 -30
- data/lib/dev_system/dev/controllers/generators/generator_generator_test.rb +0 -12
- data/lib/dev_system/dev/controllers/generators/not_found_generator.rb +0 -27
- data/lib/dev_system/dev/controllers/generators/not_found_generator_test.rb +0 -12
- data/lib/dev_system/dev/controllers/shell/dir_shell.rb +0 -27
- data/lib/dev_system/dev/controllers/shell/text_shell.rb +0 -23
- data/lib/dev_system/dev/controllers/terminal/irb_terminal_test.rb +0 -12
- data/lib/dev_system/dev/controllers/terminal/pry_terminal.rb +0 -10
- data/lib/dev_system/dev/controllers/terminal/pry_terminal_test.rb +0 -12
- data/lib/dev_system/dev/controllers/terminal.rb +0 -17
- data/lib/dev_system/dev/controllers/terminal_test.rb +0 -12
- data/lib/dev_system/dev/dev_box.rb +0 -39
- data/lib/dev_system/dev/dev_box_test.rb +0 -17
- data/lib/dev_system/dev/panels/command_panel.rb +0 -28
- data/lib/dev_system/dev/panels/command_panel_test.rb +0 -21
- data/lib/dev_system/dev/panels/generator_panel.rb +0 -3
- data/lib/dev_system/dev/panels/generator_panel_test.rb +0 -12
- data/lib/dev_system/dev/panels/log_panel.rb +0 -13
- data/lib/dev_system/dev/panels/log_panel_test.rb +0 -16
- data/lib/dev_system/dev/panels/shell_panel.rb +0 -3
- data/lib/dev_system/dev/panels/shell_panel_test.rb +0 -12
- data/lib/dev_system/dev/panels/terminal_panel.rb +0 -3
- data/lib/dev_system/dev/panels/terminal_panel_test.rb +0 -12
- data/lib/happy_system/dev/happy_command.rb +0 -11
- data/lib/happy_system/happy/controllers/axo.rb +0 -7
- data/lib/happy_system/happy/happy_box.rb +0 -9
- data/lib/happy_system/happy/happy_box_test.rb +0 -16
- data/lib/happy_system/happy/panels/axo_panel.rb +0 -3
- data/lib/liza/base/box.rb +0 -85
- data/lib/liza/base/box_test.rb +0 -10
- data/lib/liza/base_parts/controller_renderer_part.rb +0 -140
- data/lib/liza/base_parts/controller_renderer_part_test.rb +0 -16
- data/lib/liza/meta/part_extension.rb +0 -16
- data/lib/liza/test_parts/test_tree_part.rb +0 -137
- data/lib/net_system/dev/net_command.rb +0 -22
- data/lib/net_system/net/net_box.rb +0 -15
- data/lib/web_system/dev/rack_command.rb +0 -35
- data/lib/web_system/dev/request_command.rb +0 -143
- data/lib/web_system/dev/web_command.rb +0 -9
- data/lib/web_system/web/panels/rack_panel.rb +0 -42
- data/lib/web_system/web/panels/request_panel.rb +0 -72
- data/lib/web_system/web/panels/request_panel_test.rb +0 -33
- data/lib/web_system/web/web_box.rb +0 -20
- /data/lib/dev_system/{dev/panels → sub/bench}/bench_panel.rb +0 -0
- /data/lib/dev_system/{dev/controllers/shell → sub/shell/shells}/bin_shell.rb +0 -0
- /data/lib/net_system/{net/controllers → sub/client}/client.rb +0 -0
- /data/lib/net_system/{net/panels → sub/client}/client_panel.rb +0 -0
- /data/lib/net_system/{net/controllers → sub/database}/database.rb +0 -0
- /data/lib/net_system/{net/panels → sub/database}/database_panel.rb +0 -0
- /data/lib/net_system/{net/controllers/database → sub/database/databases}/redis_db.rb +0 -0
- /data/lib/net_system/{net/controllers/database → sub/database/databases}/sqlite_db.rb +0 -0
- /data/lib/net_system/{net/controllers → sub/record}/record.rb +0 -0
- /data/lib/web_system/{web/controllers → sub/rack}/rack.rb +0 -0
- /data/lib/web_system/{web/controllers → sub/request}/request.rb +0 -0
- /data/lib/web_system/{web/controllers/request → sub/request/requests}/client_error_request.rb +0 -0
- /data/lib/web_system/{web/controllers/request → sub/request/requests}/not_found_request.rb +0 -0
- /data/lib/web_system/{web/controllers/request → sub/request/requests}/server_error_request.rb +0 -0
@@ -0,0 +1,20 @@
|
|
1
|
+
class Liza::ClassTest < Liza::ObjectTest
|
2
|
+
|
3
|
+
test :subject_class do
|
4
|
+
assert_equality subject_class, Class
|
5
|
+
end
|
6
|
+
|
7
|
+
test :ancestors_until do
|
8
|
+
assert_equality [Object], Object.ancestors_until(BasicObject)
|
9
|
+
assert_equality [Integer], Integer.ancestors_until(Object)
|
10
|
+
assert_equality [Symbol], Symbol.ancestors_until(Object)
|
11
|
+
assert_equality [String], String.ancestors_until(Object)
|
12
|
+
assert_equality [Array], Array.ancestors_until(Object)
|
13
|
+
assert_equality [Hash], Hash.ancestors_until(Object)
|
14
|
+
|
15
|
+
assert_equality [IrbCommand, Command], IrbCommand.ancestors_until(Command)
|
16
|
+
assert_equality [PryCommand, Command], PryCommand.ancestors_until(Command)
|
17
|
+
assert_equality [TestCommand, Command], TestCommand.ancestors_until(Command)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class Liza::ModuleTest < Liza::
|
1
|
+
class Liza::ModuleTest < Liza::ObjectTest
|
2
2
|
|
3
3
|
test :subject_class do
|
4
4
|
assert subject_class == Module
|
@@ -8,14 +8,14 @@ class Liza::ModuleTest < Liza::RubyTest
|
|
8
8
|
assert Object.source_location == []
|
9
9
|
|
10
10
|
assert Liza::Command.source_location[1] == 1
|
11
|
-
assert
|
11
|
+
assert IrbCommand.source_location[1] == 1
|
12
12
|
end
|
13
13
|
|
14
14
|
test :source_location_radical do
|
15
15
|
assert Object.source_location_radical == nil
|
16
16
|
|
17
|
-
assert Liza::Command.source_location_radical.end_with? "/lib/dev_system/
|
18
|
-
assert
|
17
|
+
assert Liza::Command.source_location_radical.end_with? "/lib/dev_system/sub/command/command"
|
18
|
+
assert IrbCommand.source_location_radical.end_with? "/lib/dev_system/sub/command/commands/irb_command"
|
19
19
|
end
|
20
20
|
|
21
21
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class Liza::StringTest < Liza::
|
1
|
+
class Liza::StringTest < Liza::ObjectTest
|
2
2
|
|
3
3
|
test :subject_class do
|
4
4
|
assert subject_class == String
|
@@ -38,6 +38,8 @@ class Liza::StringTest < Liza::RubyTest
|
|
38
38
|
assert "ab" == "Ab".snakecase
|
39
39
|
assert "ab_c" == "AbC".snakecase
|
40
40
|
assert "ab_cd" == "AbCd".snakecase
|
41
|
+
assert "ab" == "ab".snakecase
|
42
|
+
assert "cd" == "cd".snakecase
|
41
43
|
end
|
42
44
|
|
43
45
|
test :rjust_blanks do
|
@@ -1,9 +1,40 @@
|
|
1
1
|
|
2
|
-
class Liza::TestTest < Liza::
|
2
|
+
class Liza::TestTest < Liza::UnitTest
|
3
3
|
|
4
4
|
test :settings do
|
5
|
-
|
6
|
-
|
5
|
+
assert_equality subject_class.log_level, 0
|
6
|
+
end
|
7
|
+
|
8
|
+
test_methods_defined do
|
9
|
+
on_self \
|
10
|
+
:after, :after_stack,
|
11
|
+
:before, :before_stack,
|
12
|
+
:call, :color,
|
13
|
+
:group,
|
14
|
+
:log_test_building, :log_test_building?,
|
15
|
+
:subject_class,
|
16
|
+
:subsystem,
|
17
|
+
:test, :test_node, :test_tree,
|
18
|
+
:totals
|
19
|
+
on_instance \
|
20
|
+
:assert, :assert!,
|
21
|
+
:assert_equality, :assert_equality!,
|
22
|
+
:assert_raises, :assert_raises!,
|
23
|
+
:assertions, :assertions=,
|
24
|
+
:call,
|
25
|
+
:critical,
|
26
|
+
:division,
|
27
|
+
:group,
|
28
|
+
:log_test_assertion, :log_test_assertion?,
|
29
|
+
:log_test_assertion_message, :log_test_assertion_message?,
|
30
|
+
:log_test_assertion_result, :log_test_building?,
|
31
|
+
:log_test_call, :log_test_call_block?, :log_test_call_rescue,
|
32
|
+
:refute, :refute!,
|
33
|
+
:refute_equality, :refute_equality!,
|
34
|
+
:refute_raises, :refute_raises!,
|
35
|
+
:subject, :subject_class,
|
36
|
+
:test_words,
|
37
|
+
:todo
|
7
38
|
end
|
8
39
|
|
9
40
|
group :basics do
|
@@ -74,7 +105,11 @@ class Liza::TestTest < Liza::Test
|
|
74
105
|
|
75
106
|
group :instance_variables do
|
76
107
|
test :instance_variables do
|
77
|
-
|
108
|
+
if Shell.jruby?
|
109
|
+
todo "jruby!"
|
110
|
+
else
|
111
|
+
assert_equality instance_variables, [:@test_words, :@before_stack, :@after_stack, :@test_block, :@settings]
|
112
|
+
end
|
78
113
|
end
|
79
114
|
|
80
115
|
test :test_block do
|
@@ -84,13 +119,15 @@ class Liza::TestTest < Liza::Test
|
|
84
119
|
|
85
120
|
group :tree do
|
86
121
|
test :test_tree do
|
87
|
-
assert_equality self.class.test_tree.class, Liza::TestTreePart
|
122
|
+
assert_equality self.class.test_tree.class, Liza::TestTreePart
|
88
123
|
assert_equality self.class.test_tree, self.class.test_tree.parent
|
89
124
|
|
90
|
-
assert_equality
|
125
|
+
assert_equality 4, self.class.test_tree.tests.count
|
91
126
|
assert_equality 5, self.class.test_tree.children.count
|
92
127
|
|
93
|
-
|
128
|
+
a = self.class.test_tree.tests.map(&:first).flatten
|
129
|
+
b = [:settings, :subject_class, :methods_defined, :subject_class, :instance_methods_defined, :instance_groups]
|
130
|
+
assert_equality a, b
|
94
131
|
end
|
95
132
|
end
|
96
133
|
|
@@ -16,7 +16,7 @@ class Liza::TestAssertionsAdvancedPart < Liza::Part
|
|
16
16
|
log_test_assertion __method__, kaller if _groups.empty?
|
17
17
|
|
18
18
|
if log_test_assertion_message?
|
19
|
-
msg ||= "#{__method__} #{a}, #{b} (== equality)"
|
19
|
+
msg ||= "#{__method__} #{a.inspect}, #{b.inspect} (== equality)"
|
20
20
|
log_test_assertion_message ret, msg
|
21
21
|
end
|
22
22
|
|
@@ -40,20 +40,20 @@ class Liza::TestDslPart < Liza::Part
|
|
40
40
|
log " calling stacked before blocks #{stack.map { |bl| _log_test_block bl }}".magenta if log_test_building?
|
41
41
|
stack.each do |bl|
|
42
42
|
log_test_call "B&", &bl if log_test_call_block?
|
43
|
-
instance_exec
|
43
|
+
instance_exec(&bl)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
47
|
bl = @test_block
|
48
48
|
log " calling test block #{_log_test_block bl}".magenta if log_test_building?
|
49
49
|
log_test_call "T&", &bl if log_test_call_block?
|
50
|
-
instance_exec
|
50
|
+
instance_exec(&bl)
|
51
51
|
|
52
52
|
@after_stack.each do |stack|
|
53
53
|
log " calling stacked after blocks #{stack.map { |bl| _log_test_block bl }}".magenta if log_test_building?
|
54
54
|
stack.each do |bl|
|
55
55
|
log_test_call "A&", &bl if log_test_call_block?
|
56
|
-
instance_exec
|
56
|
+
instance_exec(&bl)
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
@@ -7,6 +7,26 @@ class Liza::TestLogPart < Liza::Part
|
|
7
7
|
LOG_ASSERTION_MESSAGE = true
|
8
8
|
LOG_CALL_BLOCK = true
|
9
9
|
|
10
|
+
def self.system
|
11
|
+
subject_class.system
|
12
|
+
rescue
|
13
|
+
Liza::System
|
14
|
+
end
|
15
|
+
|
16
|
+
def system
|
17
|
+
self.class.system
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.division
|
21
|
+
subject_class.division
|
22
|
+
rescue
|
23
|
+
Liza::Controller
|
24
|
+
end
|
25
|
+
|
26
|
+
def division
|
27
|
+
self.class.division
|
28
|
+
end
|
29
|
+
|
10
30
|
def self.log_test_building?
|
11
31
|
LOG_BUILDING
|
12
32
|
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
class Liza::TestTreePart < Liza::Part
|
2
|
+
|
3
|
+
insertion do
|
4
|
+
|
5
|
+
@before_stack = []
|
6
|
+
@after_stack = []
|
7
|
+
|
8
|
+
def self.before_stack; @before_stack ||= superclass.before_stack.dup end
|
9
|
+
def self.after_stack; @after_stack ||= superclass.after_stack.dup end
|
10
|
+
|
11
|
+
def self.test_node; @test_node ||= test_tree end
|
12
|
+
def self.test_tree; @test_tree ||= Liza::TestTreePart.new nil, before_stack, after_stack end
|
13
|
+
|
14
|
+
#
|
15
|
+
|
16
|
+
def self.group *words, &block
|
17
|
+
raise ArgumentError, "No block given" unless block_given?
|
18
|
+
previous = test_node
|
19
|
+
@test_node = test_node.branch_out words
|
20
|
+
instance_exec(&block)
|
21
|
+
@test_node = previous
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.test *words, &block
|
25
|
+
raise ArgumentError, "No block given" unless block_given?
|
26
|
+
test_node.add_test words, &block
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.before &block
|
30
|
+
raise ArgumentError, "No block given" unless block_given?
|
31
|
+
test_node.add_before(&block)
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.after &block
|
35
|
+
raise ArgumentError, "No block given" unless block_given?
|
36
|
+
test_node.add_after(&block)
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
|
43
|
+
def log_test_building?
|
44
|
+
Liza::Test.log_test_building?
|
45
|
+
end
|
46
|
+
|
47
|
+
attr_reader :tests, :parent, :children, :before_stack, :after_stack
|
48
|
+
|
49
|
+
def initialize parent, before_stack, after_stack
|
50
|
+
@tests = []
|
51
|
+
initialize_parenting parent
|
52
|
+
initialize_filters before_stack, after_stack
|
53
|
+
end
|
54
|
+
|
55
|
+
def initialize_parenting parent
|
56
|
+
@parent = parent || self
|
57
|
+
@children = []
|
58
|
+
@parent.children << self if @parent != self
|
59
|
+
end
|
60
|
+
|
61
|
+
def initialize_filters before_stack, after_stack
|
62
|
+
@before_top, @after_top = [], []
|
63
|
+
@before_stack = before_stack.push @before_top
|
64
|
+
@after_stack = after_stack.unshift @after_top
|
65
|
+
end
|
66
|
+
|
67
|
+
def add_before &block
|
68
|
+
log "add_before to ##{object_id} #{block}" if log_test_building?
|
69
|
+
@before_top.push block
|
70
|
+
end
|
71
|
+
|
72
|
+
def add_test words, &block
|
73
|
+
log "add_test to ##{object_id} #{words} #{block}" if log_test_building?
|
74
|
+
tests << [words, block]
|
75
|
+
end
|
76
|
+
|
77
|
+
def add_after &block
|
78
|
+
log "add_after to ##{object_id} #{block}" if log_test_building?
|
79
|
+
@after_top.push block
|
80
|
+
end
|
81
|
+
|
82
|
+
def branch_out words, &block
|
83
|
+
self.class.new self, before_stack.dup, after_stack.dup
|
84
|
+
end
|
85
|
+
|
86
|
+
|
87
|
+
end
|
data/lib/liza/unit.rb
CHANGED
@@ -1,155 +1,99 @@
|
|
1
1
|
class Liza::Unit
|
2
2
|
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
App.connect_part self, key, system
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.const_missing name
|
10
|
-
Liza.const name
|
11
|
-
rescue Liza::ConstNotFound => e
|
12
|
-
raise NameError, "uninitialized constant #{name}", caller[1..], cause: nil
|
13
|
-
end
|
14
|
-
|
15
|
-
part :unit_procedure
|
3
|
+
# ERROR
|
4
|
+
|
5
|
+
class Error < Liza::Error; end
|
16
6
|
|
17
|
-
#
|
7
|
+
# PART
|
18
8
|
|
19
|
-
def self.
|
20
|
-
|
9
|
+
def self.part key, klass = nil, system: nil
|
10
|
+
Lizarb.connect_part self, key, klass, system
|
21
11
|
end
|
22
12
|
|
23
|
-
|
24
|
-
return settings[key] if settings.has_key? key
|
13
|
+
# CONST MISSING
|
25
14
|
|
26
|
-
|
15
|
+
if Lizarb.ruby_supports_raise_cause?
|
27
16
|
|
28
|
-
|
29
|
-
|
17
|
+
def self.const_missing name
|
18
|
+
Liza.const name
|
19
|
+
rescue Liza::ConstNotFound
|
20
|
+
raise NameError, "uninitialized constant #{name}", caller[1..], cause: nil
|
21
|
+
end
|
30
22
|
|
31
|
-
|
32
|
-
found = klass.settings[key]
|
23
|
+
else
|
33
24
|
|
34
|
-
|
35
|
-
|
25
|
+
def self.const_missing name
|
26
|
+
Liza.const name
|
27
|
+
rescue Liza::ConstNotFound
|
28
|
+
raise NameError, "uninitialized constant #{name}", caller[1..]
|
36
29
|
end
|
37
30
|
|
38
|
-
found = settings[key] = found.dup if found.is_a? Enumerable
|
39
|
-
|
40
|
-
found
|
41
31
|
end
|
42
32
|
|
43
|
-
|
44
|
-
settings[key] = value
|
45
|
-
value
|
46
|
-
end
|
33
|
+
# PARTS
|
47
34
|
|
48
|
-
|
49
|
-
if key
|
50
|
-
fetch(list) { Hash.new }[key] = value
|
51
|
-
else
|
52
|
-
fetch(list) { Set.new } << value
|
53
|
-
end
|
54
|
-
end
|
35
|
+
part :unit_classes
|
55
36
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
x
|
60
|
-
end
|
37
|
+
part :unit_logging
|
38
|
+
|
39
|
+
part :unit_methods
|
61
40
|
|
62
|
-
|
63
|
-
|
41
|
+
part :unit_procedure
|
42
|
+
|
43
|
+
class RenderError < Error; end
|
44
|
+
class RendererNotFound < RenderError; end
|
45
|
+
class RenderStackIsFull < RenderError; end
|
46
|
+
class RenderStackIsEmpty < RenderError; end
|
47
|
+
part :unit_renderer
|
48
|
+
|
49
|
+
part :unit_settings
|
50
|
+
|
51
|
+
# TEST
|
52
|
+
|
53
|
+
def self.test_class
|
54
|
+
@test_class ||=
|
55
|
+
if first_namespace == "Liza"
|
56
|
+
Liza.const_get "#{last_namespace}Test"
|
57
|
+
else
|
58
|
+
Object.const_get "#{name}Test"
|
59
|
+
end
|
64
60
|
end
|
65
61
|
|
66
|
-
|
67
|
-
return settings[key] if settings.has_key? key
|
62
|
+
# CONTROLLER
|
68
63
|
|
69
|
-
|
64
|
+
def self.division
|
65
|
+
Liza::Controller
|
70
66
|
end
|
71
67
|
|
72
|
-
|
73
|
-
settings[key] = value
|
74
|
-
end
|
68
|
+
# SYSTEM
|
75
69
|
|
76
|
-
def
|
77
|
-
if
|
78
|
-
|
70
|
+
def self.system
|
71
|
+
if name&.include? "::"
|
72
|
+
return System if first_namespace == "Liza"
|
73
|
+
Object.const_get first_namespace
|
79
74
|
else
|
80
|
-
|
75
|
+
superclass.system
|
81
76
|
end
|
82
77
|
end
|
83
78
|
|
84
|
-
|
85
|
-
x = get key
|
86
|
-
x ||= set key, eval(&block)
|
87
|
-
x
|
88
|
-
end
|
89
|
-
|
90
|
-
# LOG
|
79
|
+
singleton_class.send :public, :system
|
91
80
|
|
92
|
-
|
93
|
-
|
94
|
-
:high => 1,
|
95
|
-
:normal => 0,
|
96
|
-
:low => -1,
|
97
|
-
:lower => -2,
|
98
|
-
}
|
99
|
-
|
100
|
-
set :log_level, :normal
|
101
|
-
set :log_color, :white
|
102
|
-
|
103
|
-
#
|
104
|
-
|
105
|
-
LOG_JUST = 40
|
106
|
-
|
107
|
-
def self.log log_level = :normal, string
|
108
|
-
raise "invalid log_level `#{log_level}`" unless LOG_LEVELS.keys.include? log_level
|
109
|
-
return unless log_level? log_level
|
110
|
-
|
111
|
-
source = (self.is_a? Class) ? self : self.class
|
112
|
-
source = source.to_s.ljust(LOG_JUST).bold.colorize(source.log_color)
|
113
|
-
|
114
|
-
string = "#{source} #{string}"
|
115
|
-
|
116
|
-
DevBox[:log].call string
|
81
|
+
def system
|
82
|
+
self.class.system
|
117
83
|
end
|
118
84
|
|
119
|
-
|
120
|
-
get(:log_level) || :normal
|
121
|
-
end
|
85
|
+
public :system
|
122
86
|
|
123
|
-
|
124
|
-
# TODO
|
125
|
-
true
|
126
|
-
end
|
87
|
+
#
|
127
88
|
|
128
|
-
|
129
|
-
|
89
|
+
App.settings.each do |k, v|
|
90
|
+
set k, v
|
130
91
|
end
|
92
|
+
set :division, Liza::Controller
|
93
|
+
|
94
|
+
end
|
131
95
|
|
132
|
-
|
133
|
-
def log(...)= self.class.log(...)
|
134
|
-
def log_level(...)= self.class.log_level(...)
|
135
|
-
def log?(...)= self.class.log?(...)
|
136
|
-
def log_level?(...)= self.class.log_level?(...)
|
137
|
-
def log_color(...)= self.class.log_color(...)
|
138
|
-
|
139
|
-
# SYSTEM
|
140
|
-
|
141
|
-
def self.inherited_explicitly_sets_system
|
142
|
-
|
143
|
-
def self.inherited sub
|
144
|
-
super
|
145
|
-
|
146
|
-
return unless sub.name.to_s.include? "::"
|
147
|
-
|
148
|
-
system = Object.const_get sub.first_namespace
|
149
|
-
|
150
|
-
sub.set :system, system
|
151
|
-
end
|
96
|
+
__END__
|
152
97
|
|
153
|
-
|
154
|
-
|
155
|
-
end
|
98
|
+
# view render.txt.erb
|
99
|
+
<%= render if render_stack.any? -%>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
class Liza::UnitClassesPart < Liza::Part
|
2
|
+
|
3
|
+
insertion do
|
4
|
+
|
5
|
+
def self.subclasses_select system:
|
6
|
+
subclasses.select { _1.system? system }
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.descendants_select system:
|
10
|
+
descendants.select { _1.system? system }
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.namespace
|
14
|
+
return @namespace if defined? @namespace
|
15
|
+
|
16
|
+
@namespace ||= Object unless to_s.include? "::"
|
17
|
+
@namespace ||= Liza if to_s.start_with? "Liza::"
|
18
|
+
@namespace ||= system
|
19
|
+
@namespace
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.system? system
|
23
|
+
system = Liza.const "#{system}_system" if system.is_a? Symbol
|
24
|
+
system == get(:system)
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.reload!
|
28
|
+
Lizarb.reload
|
29
|
+
end
|
30
|
+
|
31
|
+
def reload!
|
32
|
+
Lizarb.reload
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|