lizarb 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/Gemfile.lock +10 -2
  4. data/README.md +2 -2
  5. data/app/dev/benches/app_bench.rb +5 -0
  6. data/app/dev/benches/app_bench_test.rb +7 -0
  7. data/app/dev/benches/loops_bench.rb +148 -0
  8. data/app/dev/benches/loops_bench_test.rb +11 -0
  9. data/app/dev/commands/new_command.rb +1 -61
  10. data/app/dev/generators/bench_generator.rb +67 -0
  11. data/app/dev/generators/bench_generator_test.rb +12 -0
  12. data/app/dev/generators/command_generator.rb +51 -0
  13. data/app/dev/generators/command_generator_test.rb +12 -0
  14. data/app/dev/generators/model_generator.rb +46 -0
  15. data/app/dev/generators/model_generator_test.rb +12 -0
  16. data/app/dev/generators/request_generator.rb +63 -0
  17. data/app/dev/generators/request_generator_test.rb +12 -0
  18. data/app/net/databases/redis_db_test.rb +2 -2
  19. data/app/net/databases/sqlite_db_test.rb +2 -2
  20. data/app/net_box.rb +2 -2
  21. data/lib/app.rb +1 -1
  22. data/lib/dev_system/dev/controllers/bench.rb +11 -0
  23. data/lib/dev_system/dev/controllers/bench_dsl_main_part.rb +60 -0
  24. data/lib/dev_system/dev/controllers/bench_test.rb +14 -0
  25. data/lib/dev_system/dev/controllers/command/bench_command.rb +24 -0
  26. data/lib/dev_system/dev/controllers/command/bench_command_test.rb +14 -0
  27. data/lib/dev_system/dev/controllers/command/dev_command.rb +13 -8
  28. data/lib/dev_system/dev/controllers/command/generate_command.rb +23 -0
  29. data/lib/dev_system/dev/controllers/command/generate_command_test.rb +14 -0
  30. data/lib/dev_system/dev/controllers/generator.rb +11 -0
  31. data/lib/dev_system/dev/controllers/generator_dsl_main_part.rb +54 -0
  32. data/lib/dev_system/dev/controllers/generator_test.rb +14 -0
  33. data/lib/dev_system/dev/controllers/generators/app_generator.rb +71 -0
  34. data/lib/dev_system/dev/controllers/generators/app_generator_test.rb +14 -0
  35. data/lib/dev_system/dev/controllers/shell/file_shell.rb +29 -0
  36. data/lib/dev_system/dev/controllers/shell/file_shell_test.rb +14 -0
  37. data/lib/dev_system/dev/controllers/shell.rb +19 -0
  38. data/lib/dev_system/dev/controllers/shell_test.rb +13 -0
  39. data/lib/dev_system/dev/controllers/terminal/irb_terminal.rb +19 -0
  40. data/lib/dev_system/dev/controllers/terminal/irb_terminal_test.rb +14 -0
  41. data/lib/dev_system/dev/controllers/terminal/pry_terminal.rb +12 -0
  42. data/lib/dev_system/dev/controllers/terminal/pry_terminal_test.rb +14 -0
  43. data/lib/dev_system/dev/controllers/terminal.rb +19 -0
  44. data/lib/dev_system/dev/controllers/terminal_test.rb +14 -0
  45. data/lib/dev_system/dev/dev_box.rb +3 -0
  46. data/lib/liza/test_parts/test_subject_part.rb +6 -1
  47. data/lib/liza.rb +35 -7
  48. data/lib/lizarb/ruby/class.rb +2 -0
  49. data/lib/lizarb/ruby/proc.rb +12 -0
  50. data/lib/lizarb/ruby/string.rb +16 -0
  51. data/lib/lizarb/version.rb +1 -1
  52. data/lib/net_system/net/controllers/{adapter/redis_adapter.rb → client/redis_client.rb} +2 -2
  53. data/lib/net_system/net/controllers/{adapter/redis_adapter_test.rb → client/redis_client_test.rb} +2 -2
  54. data/lib/net_system/net/controllers/{adapter/sqlite_adapter.rb → client/sqlite_client.rb} +2 -2
  55. data/lib/net_system/net/controllers/{adapter/sqlite_adapter_test.rb → client/sqlite_client_test.rb} +2 -2
  56. data/lib/net_system/net/controllers/client.rb +5 -0
  57. data/lib/net_system/net/controllers/{adapter_test.rb → client_test.rb} +2 -2
  58. data/lib/net_system/net/controllers/database/redis_db.rb +2 -2
  59. data/lib/net_system/net/controllers/database/redis_db_test.rb +1 -1
  60. data/lib/net_system/net/controllers/database/sqlite_db.rb +2 -2
  61. data/lib/net_system/net/controllers/database/sqlite_db_test.rb +1 -1
  62. data/lib/net_system/net/controllers/database.rb +6 -6
  63. data/lib/net_system/net/net_box.rb +5 -5
  64. data/lib/net_system/net/net_box_test.rb +1 -1
  65. data/lib/net_system/net/panels/client_panel.rb +5 -0
  66. data/lib/net_system/net/panels/{adapter_panel_test.rb → client_panel_test.rb} +2 -2
  67. data/tmp/.gitkeep +0 -0
  68. metadata +46 -10
  69. data/lib/net_system/net/controllers/adapter.rb +0 -5
  70. data/lib/net_system/net/panels/adapter_panel.rb +0 -5
@@ -1,10 +1,10 @@
1
1
  class NetSystem
2
- class RedisAdapter < Adapter
2
+ class RedisClient < Client
3
3
 
4
4
  # https://redis.io/
5
5
  # https://github.com/redis/redis-rb
6
6
  def initialize *args
7
- args = [url: Liza.const(:net_box).adapters.get(:redis_url)] if args.empty?
7
+ args = [url: Liza.const(:net_box).clients.get(:redis_url)] if args.empty?
8
8
  log "Connecting to #{args}"
9
9
  @conn = Redis.new *args
10
10
  end
@@ -1,12 +1,12 @@
1
1
  class NetSystem
2
- class RedisAdapterTest < AdapterTest
2
+ class RedisClientTest < ClientTest
3
3
 
4
4
  def subject
5
5
  @subject ||= subject_class.new
6
6
  end
7
7
 
8
8
  test :subject_class do
9
- assert subject_class == Liza::RedisAdapter
9
+ assert subject_class == Liza::RedisClient
10
10
  end
11
11
 
12
12
  test :subject do
@@ -1,10 +1,10 @@
1
1
  class NetSystem
2
- class SqliteAdapter < Adapter
2
+ class SqliteClient < Client
3
3
 
4
4
  # https://www.sqlite.org/
5
5
  # https://github.com/sparklemotion/sqlite3-ruby
6
6
  def initialize *args
7
- args = [Liza.const(:net_box).adapters.get(:sqlite)] if args.empty?
7
+ args = [Liza.const(:net_box).clients.get(:sqlite)] if args.empty?
8
8
  log "Connecting to #{args}"
9
9
  @conn = SQLite3::Database.new *args
10
10
  end
@@ -1,12 +1,12 @@
1
1
  class NetSystem
2
- class SqliteAdapterTest < AdapterTest
2
+ class SqliteClientTest < ClientTest
3
3
 
4
4
  def subject
5
5
  @subject ||= subject_class.new ":memory:"
6
6
  end
7
7
 
8
8
  test :subject_class do
9
- assert subject_class == Liza::SqliteAdapter
9
+ assert subject_class == Liza::SqliteClient
10
10
  end
11
11
 
12
12
  test :subject do
@@ -0,0 +1,5 @@
1
+ class NetSystem
2
+ class Client < Liza::Controller
3
+
4
+ end
5
+ end
@@ -1,8 +1,8 @@
1
1
  class NetSystem
2
- class AdapterTest < Liza::ControllerTest
2
+ class ClientTest < Liza::ControllerTest
3
3
 
4
4
  test :subject_class do
5
- assert subject_class == NetSystem::Adapter
5
+ assert subject_class == NetSystem::Client
6
6
  end
7
7
 
8
8
  test :settings do
@@ -1,9 +1,9 @@
1
1
  class NetSystem
2
2
  class RedisDb < Database
3
- set_adapter :redis
3
+ set_client :redis
4
4
 
5
5
  def now
6
- array = adapter.now
6
+ array = client.now
7
7
  Time.at array[0]
8
8
  end
9
9
 
@@ -6,7 +6,7 @@ class NetSystem
6
6
  end
7
7
 
8
8
  test :subject do
9
- assert subject.adapter.class == NetSystem::RedisAdapter
9
+ assert subject.client.class == NetSystem::RedisClient
10
10
  end
11
11
 
12
12
  test :now do
@@ -1,9 +1,9 @@
1
1
  class NetSystem
2
2
  class SqliteDb < Database
3
- set_adapter :sqlite
3
+ set_client :sqlite
4
4
 
5
5
  def now
6
- array = adapter.now
6
+ array = client.now
7
7
  Time.parse array[1][0]
8
8
  end
9
9
 
@@ -6,7 +6,7 @@ class NetSystem
6
6
  end
7
7
 
8
8
  test :subject do
9
- assert subject.adapter.class == NetSystem::SqliteAdapter
9
+ assert subject.client.class == NetSystem::SqliteClient
10
10
  end
11
11
 
12
12
  test :now do
@@ -9,14 +9,14 @@ class NetSystem
9
9
  raise "please rename #{sub.name} to #{sub.name}Db"
10
10
  end
11
11
 
12
- attr_reader :adapter
12
+ attr_reader :client
13
13
 
14
- def initialize adapter: get(:adapter).new
15
- @adapter = adapter
14
+ def initialize client: get(:client).new
15
+ @client = client
16
16
  end
17
17
 
18
- def self.set_adapter adapter_id
19
- set :adapter, Liza.const("#{adapter_id}_adapter")
18
+ def self.set_client client_id
19
+ set :client, Liza.const("#{client_id}_client")
20
20
  end
21
21
 
22
22
  def self.current
@@ -27,7 +27,7 @@ class NetSystem
27
27
  end
28
28
 
29
29
  def self.call(...); current.call(...); end
30
- def call(...); @adapter.call(...); end
30
+ def call(...); @client.call(...); end
31
31
 
32
32
  end
33
33
  end
@@ -1,11 +1,11 @@
1
1
  class NetSystem
2
2
  class NetBox < Liza::Box
3
- has_panel :adapter, :adapters
4
- has_controller :adapter, :adapters
3
+ has_panel :client, :clients
4
+ has_controller :client, :clients
5
5
 
6
- # Set up your adapter panel per the DSL in http://guides.lizarb.org/panels/adapter.html
7
- adapters do
8
- # set :log_level, ENV["net.adapter.log_level"]
6
+ # Set up your client panel per the DSL in http://guides.lizarb.org/panels/client.html
7
+ clients do
8
+ # set :log_level, ENV["net.client.log_level"]
9
9
  end
10
10
 
11
11
  has_panel :database, :databases
@@ -11,7 +11,7 @@ class NetSystem
11
11
  end
12
12
 
13
13
  test :panels do
14
- assert subject_class.adapters.is_a? AdapterPanel
14
+ assert subject_class.clients.is_a? ClientPanel
15
15
  assert subject_class.databases.is_a? DatabasePanel
16
16
  end
17
17
 
@@ -0,0 +1,5 @@
1
+ class NetSystem
2
+ class ClientPanel < Liza::Panel
3
+
4
+ end
5
+ end
@@ -1,8 +1,8 @@
1
1
  class NetSystem
2
- class AdapterPanelTest < Liza::PanelTest
2
+ class ClientPanelTest < Liza::PanelTest
3
3
 
4
4
  test :subject_class do
5
- assert subject_class == NetSystem::AdapterPanel
5
+ assert subject_class == NetSystem::ClientPanel
6
6
  end
7
7
 
8
8
  test :settings do
data/tmp/.gitkeep ADDED
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lizarb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Pinto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-11 00:00:00.000000000 Z
11
+ date: 2022-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -86,6 +86,10 @@ files:
86
86
  - app.code.env
87
87
  - app.env
88
88
  - app.rb
89
+ - app/dev/benches/app_bench.rb
90
+ - app/dev/benches/app_bench_test.rb
91
+ - app/dev/benches/loops_bench.rb
92
+ - app/dev/benches/loops_bench_test.rb
89
93
  - app/dev/commands/app_command.rb
90
94
  - app/dev/commands/app_command_test.rb
91
95
  - app/dev/commands/example_command.rb
@@ -98,6 +102,14 @@ files:
98
102
  - app/dev/commands/my_command_test.rb
99
103
  - app/dev/commands/new_command.rb
100
104
  - app/dev/commands/new_command_test.rb
105
+ - app/dev/generators/bench_generator.rb
106
+ - app/dev/generators/bench_generator_test.rb
107
+ - app/dev/generators/command_generator.rb
108
+ - app/dev/generators/command_generator_test.rb
109
+ - app/dev/generators/model_generator.rb
110
+ - app/dev/generators/model_generator_test.rb
111
+ - app/dev/generators/request_generator.rb
112
+ - app/dev/generators/request_generator_test.rb
101
113
  - app/dev_box.rb
102
114
  - app/happy/axos/axo.rb
103
115
  - app/happy_box.rb
@@ -130,16 +142,38 @@ files:
130
142
  - exe/lizarb
131
143
  - lib/app.rb
132
144
  - lib/dev_system.rb
145
+ - lib/dev_system/dev/controllers/bench.rb
146
+ - lib/dev_system/dev/controllers/bench_dsl_main_part.rb
147
+ - lib/dev_system/dev/controllers/bench_test.rb
133
148
  - lib/dev_system/dev/controllers/command.rb
149
+ - lib/dev_system/dev/controllers/command/bench_command.rb
150
+ - lib/dev_system/dev/controllers/command/bench_command_test.rb
134
151
  - lib/dev_system/dev/controllers/command/dev_command.rb
135
152
  - lib/dev_system/dev/controllers/command/dev_command_test.rb
136
153
  - lib/dev_system/dev/controllers/command/echo_command.rb
137
154
  - lib/dev_system/dev/controllers/command/echo_command_test.rb
155
+ - lib/dev_system/dev/controllers/command/generate_command.rb
156
+ - lib/dev_system/dev/controllers/command/generate_command_test.rb
138
157
  - lib/dev_system/dev/controllers/command/test_command.rb
139
158
  - lib/dev_system/dev/controllers/command/test_command_test.rb
140
159
  - lib/dev_system/dev/controllers/command/version_command.rb
141
160
  - lib/dev_system/dev/controllers/command/version_command_test.rb
142
161
  - lib/dev_system/dev/controllers/command_test.rb
162
+ - lib/dev_system/dev/controllers/generator.rb
163
+ - lib/dev_system/dev/controllers/generator_dsl_main_part.rb
164
+ - lib/dev_system/dev/controllers/generator_test.rb
165
+ - lib/dev_system/dev/controllers/generators/app_generator.rb
166
+ - lib/dev_system/dev/controllers/generators/app_generator_test.rb
167
+ - lib/dev_system/dev/controllers/shell.rb
168
+ - lib/dev_system/dev/controllers/shell/file_shell.rb
169
+ - lib/dev_system/dev/controllers/shell/file_shell_test.rb
170
+ - lib/dev_system/dev/controllers/shell_test.rb
171
+ - lib/dev_system/dev/controllers/terminal.rb
172
+ - lib/dev_system/dev/controllers/terminal/irb_terminal.rb
173
+ - lib/dev_system/dev/controllers/terminal/irb_terminal_test.rb
174
+ - lib/dev_system/dev/controllers/terminal/pry_terminal.rb
175
+ - lib/dev_system/dev/controllers/terminal/pry_terminal_test.rb
176
+ - lib/dev_system/dev/controllers/terminal_test.rb
143
177
  - lib/dev_system/dev/dev_box.rb
144
178
  - lib/dev_system/dev/dev_box_test.rb
145
179
  - lib/dev_system/dev/panels/command_panel.rb
@@ -174,17 +208,18 @@ files:
174
208
  - lib/liza/unit_test.rb
175
209
  - lib/lizarb.rb
176
210
  - lib/lizarb/ruby/class.rb
211
+ - lib/lizarb/ruby/proc.rb
177
212
  - lib/lizarb/ruby/string.rb
178
213
  - lib/lizarb/ruby/time.rb
179
214
  - lib/lizarb/version.rb
180
215
  - lib/net_system.rb
181
216
  - lib/net_system/dev/net_command.rb
182
- - lib/net_system/net/controllers/adapter.rb
183
- - lib/net_system/net/controllers/adapter/redis_adapter.rb
184
- - lib/net_system/net/controllers/adapter/redis_adapter_test.rb
185
- - lib/net_system/net/controllers/adapter/sqlite_adapter.rb
186
- - lib/net_system/net/controllers/adapter/sqlite_adapter_test.rb
187
- - lib/net_system/net/controllers/adapter_test.rb
217
+ - lib/net_system/net/controllers/client.rb
218
+ - lib/net_system/net/controllers/client/redis_client.rb
219
+ - lib/net_system/net/controllers/client/redis_client_test.rb
220
+ - lib/net_system/net/controllers/client/sqlite_client.rb
221
+ - lib/net_system/net/controllers/client/sqlite_client_test.rb
222
+ - lib/net_system/net/controllers/client_test.rb
188
223
  - lib/net_system/net/controllers/database.rb
189
224
  - lib/net_system/net/controllers/database/redis_db.rb
190
225
  - lib/net_system/net/controllers/database/redis_db_test.rb
@@ -195,8 +230,8 @@ files:
195
230
  - lib/net_system/net/controllers/model_test.rb
196
231
  - lib/net_system/net/net_box.rb
197
232
  - lib/net_system/net/net_box_test.rb
198
- - lib/net_system/net/panels/adapter_panel.rb
199
- - lib/net_system/net/panels/adapter_panel_test.rb
233
+ - lib/net_system/net/panels/client_panel.rb
234
+ - lib/net_system/net/panels/client_panel_test.rb
200
235
  - lib/net_system/net/panels/database_panel.rb
201
236
  - lib/net_system/net/panels/database_panel_test.rb
202
237
  - lib/web_system.rb
@@ -212,6 +247,7 @@ files:
212
247
  - lib/web_system/web/web_box_test.rb
213
248
  - lizarb.gemspec
214
249
  - sig/lizarb.rbs
250
+ - tmp/.gitkeep
215
251
  - web_files/favicon.ico
216
252
  - web_files/favicon.svg
217
253
  homepage: http://lizarb.org
@@ -1,5 +0,0 @@
1
- class NetSystem
2
- class Adapter < Liza::Controller
3
-
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class NetSystem
2
- class AdapterPanel < Liza::Panel
3
-
4
- end
5
- end