lizarb 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +10 -2
- data/README.md +2 -2
- 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 +148 -0
- data/app/dev/benches/loops_bench_test.rb +11 -0
- data/app/dev/commands/new_command.rb +1 -61
- data/app/dev/generators/bench_generator.rb +67 -0
- data/app/dev/generators/bench_generator_test.rb +12 -0
- data/app/dev/generators/command_generator.rb +51 -0
- data/app/dev/generators/command_generator_test.rb +12 -0
- data/app/dev/generators/model_generator.rb +46 -0
- data/app/dev/generators/model_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_box.rb +2 -2
- data/lib/app.rb +1 -1
- 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/bench_test.rb +14 -0
- data/lib/dev_system/dev/controllers/command/bench_command.rb +24 -0
- data/lib/dev_system/dev/controllers/command/bench_command_test.rb +14 -0
- data/lib/dev_system/dev/controllers/command/dev_command.rb +13 -8
- data/lib/dev_system/dev/controllers/command/generate_command.rb +23 -0
- data/lib/dev_system/dev/controllers/command/generate_command_test.rb +14 -0
- 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 +71 -0
- data/lib/dev_system/dev/controllers/generators/app_generator_test.rb +14 -0
- data/lib/dev_system/dev/controllers/shell/file_shell.rb +29 -0
- data/lib/dev_system/dev/controllers/shell/file_shell_test.rb +14 -0
- data/lib/dev_system/dev/controllers/shell.rb +19 -0
- data/lib/dev_system/dev/controllers/shell_test.rb +13 -0
- data/lib/dev_system/dev/controllers/terminal/irb_terminal.rb +19 -0
- 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/liza/test_parts/test_subject_part.rb +6 -1
- data/lib/liza.rb +35 -7
- data/lib/lizarb/ruby/class.rb +2 -0
- data/lib/lizarb/ruby/proc.rb +12 -0
- data/lib/lizarb/ruby/string.rb +16 -0
- data/lib/lizarb/version.rb +1 -1
- 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/{adapter_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/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/tmp/.gitkeep +0 -0
- metadata +46 -10
- data/lib/net_system/net/controllers/adapter.rb +0 -5
- data/lib/net_system/net/panels/adapter_panel.rb +0 -5
@@ -1,10 +1,10 @@
|
|
1
1
|
class NetSystem
|
2
|
-
class
|
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).
|
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
|
data/lib/net_system/net/controllers/{adapter/redis_adapter_test.rb → client/redis_client_test.rb}
RENAMED
@@ -1,12 +1,12 @@
|
|
1
1
|
class NetSystem
|
2
|
-
class
|
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::
|
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
|
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).
|
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
|
data/lib/net_system/net/controllers/{adapter/sqlite_adapter_test.rb → client/sqlite_client_test.rb}
RENAMED
@@ -1,12 +1,12 @@
|
|
1
1
|
class NetSystem
|
2
|
-
class
|
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::
|
9
|
+
assert subject_class == Liza::SqliteClient
|
10
10
|
end
|
11
11
|
|
12
12
|
test :subject 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 :
|
12
|
+
attr_reader :client
|
13
13
|
|
14
|
-
def initialize
|
15
|
-
@
|
14
|
+
def initialize client: get(:client).new
|
15
|
+
@client = client
|
16
16
|
end
|
17
17
|
|
18
|
-
def self.
|
19
|
-
set :
|
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(...); @
|
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 :
|
4
|
-
has_controller :
|
3
|
+
has_panel :client, :clients
|
4
|
+
has_controller :client, :clients
|
5
5
|
|
6
|
-
# Set up your
|
7
|
-
|
8
|
-
# set :log_level, ENV["net.
|
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
|
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.
|
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
|
+
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/
|
183
|
-
- lib/net_system/net/controllers/
|
184
|
-
- lib/net_system/net/controllers/
|
185
|
-
- lib/net_system/net/controllers/
|
186
|
-
- lib/net_system/net/controllers/
|
187
|
-
- lib/net_system/net/controllers/
|
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/
|
199
|
-
- lib/net_system/net/panels/
|
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
|