lizarb 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +12 -13
  3. data/Rakefile +38 -0
  4. data/app/dev_box.rb +14 -12
  5. data/app/happy_box.rb +2 -2
  6. data/app/net_box.rb +4 -4
  7. data/app/web_box.rb +4 -4
  8. data/app.rb +6 -7
  9. data/{exe/Gemfile → app_global.gemfile.rb} +2 -0
  10. data/app_global.gemfile.rb.lock +19 -0
  11. data/app_global.rb +4 -0
  12. data/{app → app_new}/dev/benches/loops_bench.rb +3 -2
  13. data/{app/dev/generators/bench_generator_test.rb → app_new/dev/benches/loops_bench_test.rb} +2 -2
  14. data/app_new/dev/benches/objects_bench.rb +83 -0
  15. data/{app/dev/generators/record_generator_test.rb → app_new/dev/benches/objects_bench_test.rb} +2 -2
  16. data/app_new/dev/benches/sorted_bench.rb +54 -0
  17. data/app_new/dev/benches/sorted_bench_test.rb +12 -0
  18. data/app_new/dev/benches/variables_bench.rb +55 -0
  19. data/{app/dev/generators/command_generator_test.rb → app_new/dev/benches/variables_bench_test.rb} +2 -2
  20. data/{app → app_new}/dev/commands/calculator_command.rb +1 -1
  21. data/{app → app_new}/dev/commands/circle_command.rb +1 -1
  22. data/{app → app_new}/dev/commands/narrative_method_command.rb +5 -7
  23. data/{app → app_new}/dev/commands/quadratic_command.rb +1 -1
  24. data/app_new/dev_box.rb +14 -0
  25. data/app_new.rb +15 -0
  26. data/exe/lizarb +9 -1
  27. data/lib/app.rb +27 -95
  28. data/lib/dev_system/dev/controllers/bench/not_found_bench.rb +15 -8
  29. data/lib/dev_system/dev/controllers/bench.rb +0 -6
  30. data/lib/dev_system/dev/controllers/command/bench_command.rb +1 -2
  31. data/lib/dev_system/dev/controllers/command/generate_command.rb +3 -27
  32. data/lib/dev_system/dev/controllers/command/new_command.rb +9 -0
  33. data/lib/dev_system/dev/controllers/command/new_command_test.rb +7 -0
  34. data/lib/dev_system/dev/controllers/command/not_found_command.rb +29 -8
  35. data/lib/dev_system/dev/controllers/command/terminal_command.rb +2 -2
  36. data/lib/dev_system/dev/controllers/command/test_command.rb +6 -6
  37. data/lib/dev_system/dev/controllers/command.rb +9 -13
  38. data/lib/dev_system/dev/controllers/generator_dsl_main_part.rb +2 -4
  39. data/{app/dev/generators/bench_generator/bench.rb.erb → lib/dev_system/dev/controllers/generators/bench_generator/controller.rb.erb} +1 -2
  40. data/{app/dev/generators/bench_generator/bench_test.rb.erb → lib/dev_system/dev/controllers/generators/bench_generator/controller_test.rb.erb} +2 -2
  41. data/lib/dev_system/dev/controllers/generators/bench_generator.rb +12 -0
  42. data/lib/dev_system/dev/controllers/generators/bench_generator_test.rb +12 -0
  43. data/lib/dev_system/dev/controllers/generators/command_generator/controller.rb.erb +41 -0
  44. data/{app/dev/generators/command_generator/command_test.rb.erb → lib/dev_system/dev/controllers/generators/command_generator/controller_test.rb.erb} +2 -2
  45. data/lib/dev_system/dev/controllers/generators/command_generator.rb +19 -0
  46. data/lib/dev_system/dev/controllers/generators/command_generator_test.rb +12 -0
  47. data/lib/dev_system/dev/controllers/generators/controller_generator.rb +97 -0
  48. data/lib/dev_system/dev/controllers/generators/controller_generator_test.rb +12 -0
  49. data/lib/dev_system/dev/controllers/generators/generator_generator/template.rb.erb +1 -1
  50. data/lib/dev_system/dev/controllers/generators/new_generator.rb +117 -0
  51. data/lib/dev_system/dev/controllers/generators/new_generator_test.rb +12 -0
  52. data/lib/dev_system/dev/controllers/generators/not_found_generator.rb +20 -8
  53. data/{app/dev → lib/dev_system/dev/controllers}/generators/record_generator.rb +1 -1
  54. data/lib/dev_system/dev/controllers/generators/record_generator_test.rb +12 -0
  55. data/{app/dev → lib/dev_system/dev/controllers}/generators/request_generator.rb +2 -2
  56. data/lib/dev_system/dev/controllers/generators/request_generator_test.rb +12 -0
  57. data/lib/dev_system/dev/controllers/log.rb +3 -0
  58. data/{app/dev/generators/request_generator_test.rb → lib/dev_system/dev/controllers/log_test.rb} +2 -2
  59. data/lib/dev_system/dev/controllers/shell.rb +22 -0
  60. data/lib/dev_system/dev/controllers/shell_test.rb +25 -0
  61. data/lib/dev_system/dev/controllers/terminal/irb_terminal.rb +7 -1
  62. data/lib/dev_system/dev/controllers/terminal/pry_terminal.rb +1 -1
  63. data/lib/dev_system/dev/dev_box.rb +12 -18
  64. data/lib/dev_system/dev/panels/command_panel.rb +54 -11
  65. data/lib/dev_system/dev/panels/command_panel_test.rb +35 -10
  66. data/lib/dev_system/dev/panels/generator_panel.rb +70 -0
  67. data/lib/dev_system/dev/panels/generator_panel_test.rb +34 -0
  68. data/lib/happy_system/happy/happy_box.rb +2 -3
  69. data/lib/lerb.rb +95 -49
  70. data/lib/liza/base/box.rb +6 -1
  71. data/lib/liza/base/panel.rb +16 -18
  72. data/lib/liza/base/panel_test.rb +27 -1
  73. data/lib/liza/base_parts/controller_renderer_part.rb +1 -1
  74. data/lib/liza/ruby_tests/module_test.rb +2 -2
  75. data/lib/liza/test/test_test.rb +5 -1
  76. data/lib/liza/test_parts/test_assertions_part.rb +1 -1
  77. data/lib/liza/test_parts/test_dsl_part.rb +3 -3
  78. data/lib/liza/test_parts/test_tree_part.rb +4 -49
  79. data/lib/liza/unit.rb +73 -79
  80. data/lib/liza/unit_parts/unit_procedure_part_test.rb +9 -9
  81. data/lib/liza/unit_parts/unit_settings_part.rb +76 -0
  82. data/lib/liza/unit_parts/unit_settings_part_test.rb +3 -0
  83. data/lib/liza/unit_test.rb +11 -0
  84. data/lib/liza.rb +10 -1
  85. data/lib/lizarb/ruby/module.rb +1 -1
  86. data/lib/lizarb/version.rb +1 -1
  87. data/lib/lizarb.rb +247 -23
  88. data/lib/net_system/dev/net_command.rb +9 -9
  89. data/lib/net_system/net/controllers/client/redis_client.rb +1 -1
  90. data/lib/net_system/net/controllers/client/sqlite_client.rb +1 -1
  91. data/lib/net_system/net/net_box.rb +4 -6
  92. data/lib/web_system/dev/rack_command.rb +1 -8
  93. data/lib/web_system/dev/request_command.rb +6 -20
  94. data/lib/web_system/web/panels/request_panel.rb +0 -2
  95. data/lib/web_system/web/web_box.rb +4 -6
  96. data/lizarb.gemspec +1 -1
  97. metadata +46 -41
  98. data/.ruby-version +0 -1
  99. data/app/dev/benches/app_bench.rb +0 -5
  100. data/app/dev/benches/app_bench_test.rb +0 -7
  101. data/app/dev/benches/loops_bench_test.rb +0 -11
  102. data/app/dev/commands/app_command.rb +0 -5
  103. data/app/dev/commands/app_command_test.rb +0 -7
  104. data/app/dev/commands/new_command.rb +0 -9
  105. data/app/dev/commands/new_command_test.rb +0 -7
  106. data/app/dev/generators/bench_generator.rb +0 -18
  107. data/app/dev/generators/command_generator/command.rb.erb +0 -26
  108. data/app/dev/generators/command_generator.rb +0 -18
  109. data/exe/Gemfile.lock +0 -13
  110. data/lib/dev_system/dev/controllers/bench_dsl_main_part.rb +0 -58
  111. data/lib/dev_system/dev/controllers/command/echo_command.rb +0 -9
  112. data/lib/dev_system/dev/controllers/command/echo_command_test.rb +0 -12
  113. data/lib/dev_system/dev/controllers/command/version_command.rb +0 -7
  114. data/lib/dev_system/dev/controllers/command/version_command_test.rb +0 -12
  115. data/lib/dev_system/dev/controllers/generators/app_generator.rb +0 -146
  116. data/lib/dev_system/dev/controllers/generators/app_generator_test.rb +0 -12
  117. /data/{app → app_new}/dev/commands/calculator_command_test.rb +0 -0
  118. /data/{app → app_new}/dev/commands/circle_command_test.rb +0 -0
  119. /data/{app → app_new}/dev/commands/narrative_method_command_test.rb +0 -0
  120. /data/{app → app_new}/dev/commands/quadratic_command_test.rb +0 -0
@@ -1,22 +1,22 @@
1
1
  class NetSystem::NetCommand < Liza::Command
2
2
 
3
3
  def self.call args
4
- log :higher, "Called #{self} with args #{args}"
4
+ log "args = #{args.inspect}"
5
5
 
6
6
  ruby_time = Time.now
7
- redis_time = ::NetBox.databases.redis.now
8
- sqlite_time = ::NetBox.databases.sqlite.now
7
+ redis_time = NetBox[:database].redis.new.now
8
+ sqlite_time = NetBox[:database].sqlite.new.now
9
9
  # redis_time = ::RedisDb.current.now
10
10
  # sqlite_time = ::SqliteDb.current.now
11
11
 
12
- puts <<-OUTPUT.bold
13
12
 
14
- Time for Ruby: #{ruby_time.to_s.light_red}
15
- Time for Redis: #{redis_time.to_s.light_red}
16
- Time for Sqlite: #{sqlite_time.to_s.light_red}
13
+ log "Time for Ruby: #{_red ruby_time}".bold
14
+ log "Time for Redis: #{_red redis_time}".bold
15
+ log "Time for Sqlite: #{_red sqlite_time}".bold
16
+ end
17
17
 
18
- OUTPUT
19
- Liza::DevCommand.call []
18
+ def self._red s
19
+ s.to_s.light_red
20
20
  end
21
21
 
22
22
  end
@@ -5,7 +5,7 @@ class NetSystem::RedisClient < NetSystem::Client
5
5
  def initialize *args
6
6
  args = [url: NetBox[:client].get(:redis_url)] if args.empty?
7
7
  log "Connecting to #{args}"
8
- @conn = Redis.new *args
8
+ @conn = Redis.new(*args)
9
9
  end
10
10
 
11
11
  attr_reader :conn
@@ -5,7 +5,7 @@ class NetSystem::SqliteClient < NetSystem::Client
5
5
  def initialize *args
6
6
  args = [NetBox[:client].get(:sqlite_path)] if args.empty?
7
7
  log "Connecting to #{args}"
8
- @conn = SQLite3::Database.new *args
8
+ @conn = SQLite3::Database.new(*args)
9
9
  end
10
10
 
11
11
  attr_reader :conn
@@ -1,15 +1,13 @@
1
1
  class NetSystem::NetBox < Liza::Box
2
2
 
3
- # Set up your client panel per the DSL in http://guides.lizarb.org/panels/client.html
4
- panel :client do
3
+ # Configure your client panel per the DSL in http://guides.lizarb.org/panels/client.html
4
+ configure :client do
5
5
  # set :log_level, ENV["net.client.log_level"]
6
6
  end
7
7
 
8
- # Set up your database panel per the DSL in http://guides.lizarb.org/panels/database.html
9
- panel :database do
8
+ # Configure your database panel per the DSL in http://guides.lizarb.org/panels/database.html
9
+ configure :database do
10
10
  # set :log_level, ENV["net.database.log_level"]
11
11
  end
12
12
 
13
- has_controller :client, :client
14
- has_controller :database, :database
15
13
  end
@@ -1,14 +1,7 @@
1
1
  class WebSystem::RackCommand < Liza::Command
2
2
 
3
- def self.call args
4
- log "Called #{self}.#{__method__} with args #{args}"
5
- new.call args
6
- end
7
-
8
- # instance methods
9
-
10
3
  def call args
11
- log "Called #{self}.#{__method__} with args #{args}"
4
+ log "args = #{args.inspect}"
12
5
 
13
6
  strategy = nil
14
7
  host = nil
@@ -2,15 +2,8 @@ class WebSystem::RequestCommand < Liza::Command
2
2
 
3
3
  VALID_ACTIONS = %w[find get post]
4
4
 
5
- def self.call(args)
6
- log "Called #{self}.#{__method__} with args #{args}"
7
- new.call(args)
8
- end
9
-
10
- # instance methods
11
-
12
5
  def call(args)
13
- log "Called #{self}.#{__method__} with args #{args}"
6
+ log "args = #{args.inspect}"
14
7
 
15
8
  @command = args.shift
16
9
  @args = args
@@ -23,8 +16,6 @@ class WebSystem::RequestCommand < Liza::Command
23
16
  end
24
17
 
25
18
  def perform
26
- log "Called #{self}.#{__method__}"
27
-
28
19
  case @command
29
20
  when "find"
30
21
  find
@@ -36,19 +27,16 @@ class WebSystem::RequestCommand < Liza::Command
36
27
  end
37
28
 
38
29
  def handle
39
- log "Called #{self}.#{__method__}"
40
30
  log render "error.txt"
41
31
  end
42
32
 
43
33
  def help
44
- log "Called #{self}.#{__method__}"
45
34
  log render "help.txt"
46
35
  end
47
36
 
48
37
  # actions
49
38
 
50
39
  def find
51
- log "Called #{self}.#{__method__}"
52
40
  path = @args.first
53
41
 
54
42
  @env = {}
@@ -62,7 +50,6 @@ class WebSystem::RequestCommand < Liza::Command
62
50
  end
63
51
 
64
52
  def get_request
65
- log "Called #{self}.#{__method__}"
66
53
  path = @args.first
67
54
 
68
55
  @env = {}
@@ -75,7 +62,6 @@ class WebSystem::RequestCommand < Liza::Command
75
62
  end
76
63
 
77
64
  def post_request
78
- log "Called #{self}.#{__method__}"
79
65
  path = @args.first
80
66
 
81
67
  @env = {}
@@ -96,14 +82,14 @@ end
96
82
 
97
83
  __END__
98
84
 
99
- # success.txt.erb
85
+ # view success.txt.erb
100
86
 
101
87
  RESULT:
102
88
 
103
89
  class <%= @result.class %>
104
90
  value <%= @result %>
105
91
 
106
- # error.txt.erb
92
+ # view error.txt.erb
107
93
 
108
94
  ERROR:
109
95
 
@@ -111,7 +97,7 @@ class <%= @error.class %>
111
97
  message <%= @error.message %>
112
98
  backtrace <%= @error.backtrace.select { |s| @stop = true if s.include?("/exe/lizarb:"); !defined? @stop }.join "\n " %>
113
99
 
114
- # help.txt.erb
100
+ # view help.txt.erb
115
101
 
116
102
  USAGE:
117
103
 
@@ -119,7 +105,7 @@ liza request find /path/to/action.format
119
105
  liza request get /path/to/action.format
120
106
  liza request post /path/to/action.format
121
107
 
122
- # find.txt.erb
108
+ # view find.txt.erb
123
109
 
124
110
  ENV:
125
111
  <% @env.each do |k, v| %>
@@ -133,7 +119,7 @@ class <%= @request_class %> < <%= @request_class.superclass %>
133
119
  # ...
134
120
  end
135
121
 
136
- # response.http.erb
122
+ # view response.http.erb
137
123
 
138
124
  <%= @status %>
139
125
  <% @headers.each do |k, v| -%>
@@ -22,8 +22,6 @@ class WebSystem::RequestPanel < Liza::Panel
22
22
  def find env
23
23
  _prepare env
24
24
 
25
- path = env["LIZA_PATH"]
26
-
27
25
  segments = env["LIZA_SEGMENTS"].dup
28
26
  request = segments.shift || "root"
29
27
  action = segments.shift || "index"
@@ -1,7 +1,7 @@
1
1
  class WebSystem::WebBox < Liza::Box
2
2
 
3
- # Set up your rack panel per the DSL in http://guides.lizarb.org/panels/rack.html
4
- panel :rack do
3
+ # Configure your rack panel per the DSL in http://guides.lizarb.org/panels/rack.html
4
+ configure :rack do
5
5
  # set :log_level, ENV["web.rack.log_level"]
6
6
 
7
7
  set :files, App.root.join("web_files")
@@ -9,12 +9,10 @@ class WebSystem::WebBox < Liza::Box
9
9
  set :port, 3000
10
10
  end
11
11
 
12
- # Set up your request panel per the DSL in http://guides.lizarb.org/panels/request.html
13
- panel :request do
12
+ # Configure your request panel per the DSL in http://guides.lizarb.org/panels/request.html
13
+ configure :request do
14
14
  # set :log_level, ENV["web.request.log_level"]
15
15
 
16
16
  end
17
17
 
18
- has_controller :rack, :rack
19
- has_controller :request, :request
20
18
  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.2.0"
15
+ spec.required_ruby_version = ">= 3.1.0"
16
16
 
17
17
  spec.metadata = {
18
18
  "homepage_uri" => "https://github.com/rubyonrails-brasil/lizarb",
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.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Pinto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-06 00:00:00.000000000 Z
11
+ date: 2023-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -76,7 +76,6 @@ executables:
76
76
  extensions: []
77
77
  extra_rdoc_files: []
78
78
  files:
79
- - ".ruby-version"
80
79
  - ".tool-versions"
81
80
  - CHANGELOG.md
82
81
  - CODE_OF_CONDUCT.md
@@ -89,34 +88,6 @@ files:
89
88
  - app.code.env
90
89
  - app.env
91
90
  - 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
96
- - app/dev/commands/app_command.rb
97
- - app/dev/commands/app_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
104
- - app/dev/commands/new_command.rb
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
120
91
  - app/dev_box.rb
121
92
  - app/happy/axos/axo.rb
122
93
  - app/happy_box.rb
@@ -140,8 +111,27 @@ files:
140
111
  - app/web/requests/root_request.rb
141
112
  - app/web/requests/root_request_test.rb
142
113
  - app/web_box.rb
143
- - exe/Gemfile
144
- - exe/Gemfile.lock
114
+ - app_global.gemfile.rb
115
+ - app_global.gemfile.rb.lock
116
+ - app_global.rb
117
+ - app_new.rb
118
+ - app_new/dev/benches/loops_bench.rb
119
+ - app_new/dev/benches/loops_bench_test.rb
120
+ - app_new/dev/benches/objects_bench.rb
121
+ - app_new/dev/benches/objects_bench_test.rb
122
+ - app_new/dev/benches/sorted_bench.rb
123
+ - app_new/dev/benches/sorted_bench_test.rb
124
+ - app_new/dev/benches/variables_bench.rb
125
+ - app_new/dev/benches/variables_bench_test.rb
126
+ - app_new/dev/commands/calculator_command.rb
127
+ - app_new/dev/commands/calculator_command_test.rb
128
+ - app_new/dev/commands/circle_command.rb
129
+ - app_new/dev/commands/circle_command_test.rb
130
+ - app_new/dev/commands/narrative_method_command.rb
131
+ - app_new/dev/commands/narrative_method_command_test.rb
132
+ - app_new/dev/commands/quadratic_command.rb
133
+ - app_new/dev/commands/quadratic_command_test.rb
134
+ - app_new/dev_box.rb
145
135
  - exe/liza
146
136
  - exe/lizarb
147
137
  - exe/lrb
@@ -150,37 +140,50 @@ files:
150
140
  - lib/dev_system/dev/controllers/bench.rb
151
141
  - lib/dev_system/dev/controllers/bench/not_found_bench.rb
152
142
  - lib/dev_system/dev/controllers/bench/not_found_bench_test.rb
153
- - lib/dev_system/dev/controllers/bench_dsl_main_part.rb
154
143
  - lib/dev_system/dev/controllers/bench_test.rb
155
144
  - lib/dev_system/dev/controllers/command.rb
156
145
  - lib/dev_system/dev/controllers/command/bench_command.rb
157
146
  - lib/dev_system/dev/controllers/command/bench_command_test.rb
158
- - lib/dev_system/dev/controllers/command/echo_command.rb
159
- - lib/dev_system/dev/controllers/command/echo_command_test.rb
160
147
  - lib/dev_system/dev/controllers/command/generate_command.rb
161
148
  - lib/dev_system/dev/controllers/command/generate_command_test.rb
149
+ - lib/dev_system/dev/controllers/command/new_command.rb
150
+ - lib/dev_system/dev/controllers/command/new_command_test.rb
162
151
  - lib/dev_system/dev/controllers/command/not_found_command.rb
163
152
  - lib/dev_system/dev/controllers/command/not_found_command_test.rb
164
153
  - lib/dev_system/dev/controllers/command/terminal_command.rb
165
154
  - lib/dev_system/dev/controllers/command/terminal_command_test.rb
166
155
  - lib/dev_system/dev/controllers/command/test_command.rb
167
156
  - lib/dev_system/dev/controllers/command/test_command_test.rb
168
- - lib/dev_system/dev/controllers/command/version_command.rb
169
- - lib/dev_system/dev/controllers/command/version_command_test.rb
170
157
  - lib/dev_system/dev/controllers/command_test.rb
171
158
  - lib/dev_system/dev/controllers/generator.rb
172
159
  - lib/dev_system/dev/controllers/generator_dsl_main_part.rb
173
160
  - lib/dev_system/dev/controllers/generator_test.rb
174
- - lib/dev_system/dev/controllers/generators/app_generator.rb
175
- - lib/dev_system/dev/controllers/generators/app_generator_test.rb
161
+ - lib/dev_system/dev/controllers/generators/bench_generator.rb
162
+ - lib/dev_system/dev/controllers/generators/bench_generator/controller.rb.erb
163
+ - lib/dev_system/dev/controllers/generators/bench_generator/controller_test.rb.erb
164
+ - lib/dev_system/dev/controllers/generators/bench_generator_test.rb
165
+ - lib/dev_system/dev/controllers/generators/command_generator.rb
166
+ - lib/dev_system/dev/controllers/generators/command_generator/controller.rb.erb
167
+ - lib/dev_system/dev/controllers/generators/command_generator/controller_test.rb.erb
168
+ - lib/dev_system/dev/controllers/generators/command_generator_test.rb
169
+ - lib/dev_system/dev/controllers/generators/controller_generator.rb
170
+ - lib/dev_system/dev/controllers/generators/controller_generator_test.rb
176
171
  - lib/dev_system/dev/controllers/generators/generator_generator.rb
177
172
  - lib/dev_system/dev/controllers/generators/generator_generator/generator.rb.erb
178
173
  - lib/dev_system/dev/controllers/generators/generator_generator/generator_test.rb.erb
179
174
  - lib/dev_system/dev/controllers/generators/generator_generator/template.rb.erb
180
175
  - lib/dev_system/dev/controllers/generators/generator_generator/template_test.rb.erb
181
176
  - lib/dev_system/dev/controllers/generators/generator_generator_test.rb
177
+ - lib/dev_system/dev/controllers/generators/new_generator.rb
178
+ - lib/dev_system/dev/controllers/generators/new_generator_test.rb
182
179
  - lib/dev_system/dev/controllers/generators/not_found_generator.rb
183
180
  - lib/dev_system/dev/controllers/generators/not_found_generator_test.rb
181
+ - lib/dev_system/dev/controllers/generators/record_generator.rb
182
+ - lib/dev_system/dev/controllers/generators/record_generator_test.rb
183
+ - lib/dev_system/dev/controllers/generators/request_generator.rb
184
+ - lib/dev_system/dev/controllers/generators/request_generator_test.rb
185
+ - lib/dev_system/dev/controllers/log.rb
186
+ - lib/dev_system/dev/controllers/log_test.rb
184
187
  - lib/dev_system/dev/controllers/shell.rb
185
188
  - lib/dev_system/dev/controllers/shell/bin_shell.rb
186
189
  - lib/dev_system/dev/controllers/shell/bin_shell_test.rb
@@ -246,6 +249,8 @@ files:
246
249
  - lib/liza/unit.rb
247
250
  - lib/liza/unit_parts/unit_procedure_part.rb
248
251
  - lib/liza/unit_parts/unit_procedure_part_test.rb
252
+ - lib/liza/unit_parts/unit_settings_part.rb
253
+ - lib/liza/unit_parts/unit_settings_part_test.rb
249
254
  - lib/liza/unit_test.rb
250
255
  - lib/lizarb.rb
251
256
  - lib/lizarb/ruby/class.rb
@@ -314,7 +319,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
314
319
  requirements:
315
320
  - - ">="
316
321
  - !ruby/object:Gem::Version
317
- version: 3.2.0
322
+ version: 3.1.0
318
323
  required_rubygems_version: !ruby/object:Gem::Requirement
319
324
  requirements:
320
325
  - - ">="
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.2.0
@@ -1,5 +0,0 @@
1
- class AppBench < Liza::Bench
2
-
3
- # Set up your bench controllers per the DSL in http://guides.lizarb.org/controllers/bench.html
4
-
5
- end
@@ -1,7 +0,0 @@
1
- class AppBenchTest < Liza::BenchTest
2
-
3
- test :subject_class do
4
- assert subject_class == AppBench
5
- end
6
-
7
- end
@@ -1,11 +0,0 @@
1
- class LoopsBenchTest < AppBenchTest
2
-
3
- test :subject_class do
4
- assert subject_class == LoopsBench
5
- end
6
-
7
- test :marks do
8
- assert subject_class.marks.keys.count.positive?
9
- end
10
-
11
- end
@@ -1,5 +0,0 @@
1
- class AppCommand < Liza::Command
2
-
3
- # Set up your command controllers per the DSL in http://guides.lizarb.org/controllers/command.html
4
-
5
- end
@@ -1,7 +0,0 @@
1
- class AppCommandTest < Liza::CommandTest
2
-
3
- test :subject_class do
4
- assert subject_class == AppCommand
5
- end
6
-
7
- end
@@ -1,9 +0,0 @@
1
- class NewCommand < AppCommand
2
-
3
- def self.call args
4
- log :higher, "Called #{self}.#{__method__} with args #{args}"
5
-
6
- Liza::GenerateCommand.call ["app", *args]
7
- end
8
-
9
- end
@@ -1,7 +0,0 @@
1
- class NewCommandTest < AppCommandTest
2
-
3
- test :subject_class do
4
- assert subject_class == NewCommand
5
- end
6
-
7
- end
@@ -1,18 +0,0 @@
1
- class BenchGenerator < Liza::Generator
2
- main_dsl
3
-
4
- FOLDER = "app/dev/benches"
5
-
6
- generate :controller do
7
- folder FOLDER
8
- filename "#{name}_bench.rb"
9
- content render "bench.rb"
10
- end
11
-
12
- generate :controller_test do
13
- folder FOLDER
14
- filename "#{name}_bench_test.rb"
15
- content render "bench_test.rb"
16
- end
17
-
18
- end
@@ -1,26 +0,0 @@
1
- class <%= name.camelize %>Command < AppCommand
2
-
3
- def self.call args
4
- log :higher, "Called #{self}.#{__method__} with args #{args}"
5
- new(args).call
6
- end
7
-
8
- def initialize args
9
- @args = args
10
- end
11
-
12
- def call
13
- log :higher, "Called #{self}.#{__method__}"
14
-
15
- text = render "text.txt"
16
-
17
- log :higher, "text: #{text}"
18
- end
19
-
20
- end
21
-
22
- __END__
23
-
24
- # text.txt.erb
25
- Called <%%= self %>.<%%= __method__ %>
26
- @args: <%%= @args %>
@@ -1,18 +0,0 @@
1
- class CommandGenerator < Liza::Generator
2
- main_dsl
3
-
4
- FOLDER = "app/dev/commands"
5
-
6
- generate :controller do
7
- folder FOLDER
8
- filename "#{name}_command.rb"
9
- content render "command.rb"
10
- end
11
-
12
- generate :controller_test do
13
- folder FOLDER
14
- filename "#{name}_command_test.rb"
15
- content render "command_test.rb"
16
- end
17
-
18
- end
data/exe/Gemfile.lock DELETED
@@ -1,13 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- colorize (0.8.1)
5
-
6
- PLATFORMS
7
- x86_64-linux
8
-
9
- DEPENDENCIES
10
- colorize (~> 0.8.1)
11
-
12
- BUNDLED WITH
13
- 2.3.9
@@ -1,58 +0,0 @@
1
- class DevSystem::BenchDslMainPart < Liza::Part
2
-
3
- insertion do
4
-
5
- def self.call args
6
- log :higher, "Called #{self}.#{__method__} with args #{args}"
7
-
8
- # https://rubyapi.org/3.1/o/benchmark
9
- require "benchmark"
10
-
11
- if @setup_bl
12
- log "Setting up..."
13
- instance_exec &@setup_bl
14
- log "Set up"
15
- end
16
-
17
- log "Benchmarking #{marks.count} Ruby Blocks"
18
- puts
19
-
20
- length = marks.keys.map(&:length).max
21
-
22
- marks.each do |label, bl|
23
- log "Benchmarking #{label}"
24
- marks[label] = Benchmark.measure label, &bl
25
- end
26
-
27
- puts
28
-
29
- log "#{"Reporting".ljust_blanks(length + 17)} App CPU Time Kernel CPU Time Total CPU Time"
30
- puts
31
-
32
- sorted = marks.sort_by { |_k, tms| tms.total }.to_h
33
-
34
- sorted.each.with_index do |(label, tms), i|
35
- tms = tms.format "%10.6u %10.6y %10.6t"
36
- s = "[#{i.next.to_s.rjust_zeroes 2}/#{marks.count.to_s.rjust_zeroes 2}] #{label.rjust_blanks length} #{tms}"
37
-
38
- s = s.green if i == 0
39
- s = s.red if i == marks.count-1
40
- log s
41
- end
42
- puts
43
- log "Done"
44
- end
45
-
46
- #
47
-
48
- def self.marks()= @marks ||= {}
49
-
50
- def self.mark(label, &block)= marks[label] = block
51
-
52
- def self.setup &block
53
- @setup_bl = block if block_given?
54
- end
55
-
56
- end
57
-
58
- end
@@ -1,9 +0,0 @@
1
- class DevSystem::EchoCommand < DevSystem::Command
2
-
3
- def self.call args
4
- log :higher, "Called #{self} with args #{args}"
5
-
6
- raise RuntimeError, args.to_s
7
- end
8
-
9
- end
@@ -1,12 +0,0 @@
1
- class DevSystem::EchoCommandTest < DevSystem::CommandTest
2
-
3
- test :subject_class do
4
- assert subject_class == DevSystem::EchoCommand
5
- end
6
-
7
- test :settings do
8
- assert subject_class.log_level == :normal
9
- assert subject_class.log_color == :green
10
- end
11
-
12
- end
@@ -1,7 +0,0 @@
1
- class DevSystem::VersionCommand < DevSystem::Command
2
-
3
- def self.call args
4
- puts Lizarb::VERSION
5
- end
6
-
7
- end
@@ -1,12 +0,0 @@
1
- class DevSystem::VersionCommandTest < DevSystem::CommandTest
2
-
3
- test :subject_class do
4
- assert subject_class == DevSystem::VersionCommand
5
- end
6
-
7
- test :settings do
8
- assert subject_class.log_level == :normal
9
- assert subject_class.log_color == :green
10
- end
11
-
12
- end