lizarb 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.tool-versions +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +14 -3
- data/README.md +23 -64
- data/README_SYSTEMS.md +80 -0
- data/Rakefile +3 -1
- data/app/dev/benches/app_bench.rb +5 -0
- data/app/dev/benches/app_bench_test.rb +7 -0
- data/app/dev/benches/loops_bench.rb +183 -0
- data/app/dev/benches/loops_bench_test.rb +11 -0
- data/app/dev/commands/calculator_command.rb +69 -0
- data/app/dev/commands/calculator_command_test.rb +58 -0
- data/app/dev/commands/circle_command.rb +70 -0
- data/app/dev/commands/circle_command_test.rb +76 -0
- data/app/dev/commands/narrative_method_command.rb +60 -0
- data/app/dev/commands/narrative_method_command_test.rb +36 -0
- data/app/dev/commands/new_command.rb +1 -61
- data/app/dev/commands/quadratic_command.rb +66 -0
- data/app/dev/commands/quadratic_command_test.rb +47 -0
- data/app/dev/generators/bench_generator/bench.rb.erb +24 -0
- data/app/dev/generators/bench_generator/bench_test.rb.erb +12 -0
- data/app/dev/generators/bench_generator.rb +18 -0
- data/app/dev/generators/bench_generator_test.rb +12 -0
- data/app/dev/generators/command_generator/command.rb.erb +26 -0
- data/app/dev/generators/command_generator/command_test.rb.erb +12 -0
- data/app/dev/generators/command_generator.rb +18 -0
- data/app/dev/generators/command_generator_test.rb +12 -0
- data/app/dev/generators/record_generator.rb +46 -0
- data/app/dev/generators/record_generator_test.rb +12 -0
- data/app/dev/generators/request_generator.rb +63 -0
- data/app/dev/generators/request_generator_test.rb +12 -0
- data/app/net/databases/redis_db_test.rb +2 -2
- data/app/net/databases/sqlite_db_test.rb +2 -2
- data/app/net/{models/app_model.rb → records/app_record.rb} +2 -1
- data/app/net/{models/post_model_test.rb → records/app_record_test.rb} +2 -2
- data/app/net/records/post_record.rb +4 -0
- data/app/net/{models/app_model_test.rb → records/post_record_test.rb} +2 -2
- data/app/net/records/user_record.rb +4 -0
- data/app/net/{models/user_model_test.rb → records/user_record_test.rb} +2 -2
- data/app/net_box.rb +2 -2
- data/app/web/requests/api_request.rb +8 -7
- data/app/web/requests/assets_request.rb +12 -13
- data/app/web/requests/root_request.rb +6 -7
- data/app/web/requests/root_request_test.rb +1 -1
- data/app/web_box.rb +8 -0
- data/app_new/Procfile +1 -1
- data/exe/lrb +3 -0
- data/lib/app.rb +18 -14
- data/lib/dev_system/dev/controllers/bench/not_found_bench.rb +29 -0
- data/lib/dev_system/dev/controllers/bench/not_found_bench_test.rb +14 -0
- data/lib/dev_system/dev/controllers/bench.rb +11 -0
- data/lib/dev_system/dev/controllers/bench_dsl_main_part.rb +60 -0
- data/lib/dev_system/dev/controllers/{command/dev_command_test.rb → bench_test.rb} +2 -2
- data/lib/dev_system/dev/controllers/command/bench_command.rb +34 -0
- data/lib/dev_system/dev/controllers/command/bench_command_test.rb +14 -0
- data/lib/dev_system/dev/controllers/command/generate_command.rb +35 -0
- data/lib/dev_system/dev/controllers/command/generate_command_test.rb +14 -0
- data/lib/dev_system/dev/controllers/command/not_found_command.rb +29 -0
- data/lib/dev_system/dev/controllers/command/not_found_command_test.rb +14 -0
- data/lib/dev_system/dev/controllers/command/terminal_command.rb +24 -0
- data/lib/dev_system/dev/controllers/command/terminal_command_test.rb +14 -0
- data/lib/dev_system/dev/controllers/command/test_command.rb +6 -2
- data/lib/dev_system/dev/controllers/generator.rb +11 -0
- data/lib/dev_system/dev/controllers/generator_dsl_main_part.rb +54 -0
- data/lib/dev_system/dev/controllers/generator_test.rb +14 -0
- data/lib/dev_system/dev/controllers/generators/app_generator.rb +96 -0
- data/lib/dev_system/dev/controllers/generators/app_generator_test.rb +14 -0
- data/lib/dev_system/dev/controllers/generators/generator_generator/generator.rb.erb +18 -0
- data/lib/dev_system/dev/controllers/generators/generator_generator/generator_test.rb.erb +12 -0
- data/lib/dev_system/dev/controllers/generators/generator_generator/template.rb.erb +9 -0
- data/lib/dev_system/dev/controllers/generators/generator_generator/template_test.rb.erb +12 -0
- data/lib/dev_system/dev/controllers/generators/generator_generator.rb +30 -0
- data/lib/dev_system/dev/controllers/generators/generator_generator_test.rb +12 -0
- data/lib/dev_system/dev/controllers/generators/not_found_generator.rb +29 -0
- data/lib/dev_system/dev/controllers/generators/not_found_generator_test.rb +14 -0
- data/lib/dev_system/dev/controllers/shell/bin_shell.rb +22 -0
- data/lib/dev_system/dev/controllers/shell/bin_shell_test.rb +87 -0
- data/lib/dev_system/dev/controllers/shell/dir_shell.rb +27 -0
- data/lib/dev_system/dev/controllers/shell/dir_shell_test.rb +73 -0
- data/lib/dev_system/dev/controllers/shell/file_shell.rb +59 -0
- data/lib/dev_system/dev/controllers/shell/file_shell_test.rb +150 -0
- data/lib/dev_system/dev/controllers/shell/text_shell.rb +23 -0
- data/lib/dev_system/dev/controllers/shell/text_shell_test.rb +84 -0
- data/lib/dev_system/dev/controllers/shell.rb +31 -0
- data/lib/dev_system/dev/controllers/shell_test.rb +46 -0
- data/lib/dev_system/dev/controllers/{command/dev_command.rb → terminal/irb_terminal.rb} +2 -2
- data/lib/dev_system/dev/controllers/terminal/irb_terminal_test.rb +14 -0
- data/lib/dev_system/dev/controllers/terminal/pry_terminal.rb +12 -0
- data/lib/dev_system/dev/controllers/terminal/pry_terminal_test.rb +14 -0
- data/lib/dev_system/dev/controllers/terminal.rb +19 -0
- data/lib/dev_system/dev/controllers/terminal_test.rb +14 -0
- data/lib/dev_system/dev/dev_box.rb +3 -0
- data/lib/dev_system/dev/panels/command_panel.rb +21 -1
- data/lib/dev_system/dev/panels/log_panel.rb +1 -1
- data/lib/lerb.rb +106 -0
- data/lib/liza/base/controller.rb +2 -0
- data/lib/liza/base/panel.rb +6 -5
- data/lib/liza/base_parts/controller_renderer_part.rb +140 -0
- data/lib/liza/base_parts/controller_renderer_part_test.rb +16 -0
- data/lib/liza/meta/part_extension.rb +6 -1
- data/lib/liza/ruby_test.rb +9 -0
- data/lib/liza/ruby_tests/module_test.rb +21 -0
- data/lib/liza/ruby_tests/string_test.rb +59 -0
- data/lib/liza/test/test.rb +3 -1
- data/lib/liza/test/test_test.rb +108 -15
- data/lib/liza/test_parts/test_assertions_advanced_part.rb +127 -0
- data/lib/liza/test_parts/test_assertions_part.rb +7 -6
- data/lib/liza/test_parts/test_dsl_part.rb +37 -89
- data/lib/liza/test_parts/test_log_part.rb +124 -0
- data/lib/liza/test_parts/test_subject_part.rb +6 -1
- data/lib/liza/test_parts/test_tree_part.rb +139 -0
- data/lib/liza/unit.rb +2 -0
- data/lib/liza/unit_parts/unit_procedure_part.rb +17 -0
- data/lib/liza/unit_parts/unit_procedure_part_test.rb +65 -0
- data/lib/liza.rb +40 -7
- data/lib/lizarb/ruby/class.rb +2 -0
- data/lib/lizarb/ruby/module.rb +17 -0
- data/lib/lizarb/ruby/proc.rb +12 -0
- data/lib/lizarb/ruby/string.rb +26 -2
- data/lib/lizarb/version.rb +1 -1
- data/lib/lizarb.rb +24 -2
- data/lib/net_system/net/controllers/{adapter/redis_adapter.rb → client/redis_client.rb} +2 -2
- data/lib/net_system/net/controllers/{adapter/redis_adapter_test.rb → client/redis_client_test.rb} +2 -2
- data/lib/net_system/net/controllers/{adapter/sqlite_adapter.rb → client/sqlite_client.rb} +2 -2
- data/lib/net_system/net/controllers/{adapter/sqlite_adapter_test.rb → client/sqlite_client_test.rb} +2 -2
- data/lib/net_system/net/controllers/client.rb +5 -0
- data/lib/net_system/net/controllers/{model_test.rb → client_test.rb} +2 -2
- data/lib/net_system/net/controllers/database/redis_db.rb +2 -2
- data/lib/net_system/net/controllers/database/redis_db_test.rb +1 -1
- data/lib/net_system/net/controllers/database/sqlite_db.rb +2 -2
- data/lib/net_system/net/controllers/database/sqlite_db_test.rb +1 -1
- data/lib/net_system/net/controllers/database.rb +6 -6
- data/lib/net_system/net/controllers/record.rb +31 -0
- data/lib/net_system/net/controllers/{adapter_test.rb → record_test.rb} +2 -2
- data/lib/net_system/net/net_box.rb +5 -5
- data/lib/net_system/net/net_box_test.rb +1 -1
- data/lib/net_system/net/panels/client_panel.rb +5 -0
- data/lib/net_system/net/panels/{adapter_panel_test.rb → client_panel_test.rb} +2 -2
- data/lib/web_system/dev/rack_command.rb +26 -0
- data/lib/web_system/dev/request_command.rb +143 -0
- data/lib/web_system/dev/web_command.rb +3 -34
- data/lib/web_system/web/controllers/rack.rb +8 -0
- data/lib/web_system/web/controllers/rack_test.rb +18 -0
- data/lib/web_system/web/controllers/request/client_error_request.rb +0 -1
- data/lib/web_system/web/controllers/request/not_found_request.rb +0 -1
- data/lib/web_system/web/controllers/request/server_error_request.rb +0 -1
- data/lib/web_system/web/panels/rack_panel.rb +44 -0
- data/lib/web_system/web/panels/rack_panel_test.rb +14 -0
- data/lib/web_system/web/panels/request_panel.rb +51 -32
- data/lib/web_system/web/panels/request_panel_test.rb +28 -9
- data/lib/web_system/web/web_box.rb +12 -0
- data/lizarb.gemspec +2 -2
- data/tmp/.gitkeep +0 -0
- metadata +110 -31
- data/app/dev/commands/example_command.rb +0 -57
- data/app/dev/commands/example_command_test.rb +0 -43
- data/app/dev/commands/macro_child_command.rb +0 -32
- data/app/dev/commands/macro_child_command_test.rb +0 -7
- data/app/dev/commands/macro_parent_command.rb +0 -70
- data/app/dev/commands/macro_parent_command_test.rb +0 -7
- data/app/dev/commands/my_command.rb +0 -7
- data/app/dev/commands/my_command_test.rb +0 -7
- data/app/net/models/post_model.rb +0 -4
- data/app/net/models/user_model.rb +0 -4
- data/lib/liza/test_parts/test_context_part.rb +0 -81
- data/lib/net_system/net/controllers/adapter.rb +0 -5
- data/lib/net_system/net/controllers/model.rb +0 -31
- data/lib/net_system/net/panels/adapter_panel.rb +0 -5
@@ -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,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
|