lizarb 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/.ruby-version +1 -0
- data/CHANGELOG.md +13 -2
- data/Gemfile +22 -2
- data/Gemfile.lock +52 -0
- data/README.md +88 -12
- 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/app_command.rb +5 -0
- data/app/dev/commands/app_command_test.rb +7 -0
- data/app/dev/commands/example_command.rb +57 -0
- data/app/dev/commands/example_command_test.rb +43 -0
- data/app/dev/commands/macro_child_command.rb +32 -0
- data/app/dev/commands/macro_child_command_test.rb +7 -0
- data/app/dev/commands/macro_parent_command.rb +70 -0
- data/app/dev/commands/macro_parent_command_test.rb +7 -0
- data/app/dev/commands/my_command.rb +7 -0
- data/app/dev/commands/my_command_test.rb +7 -0
- data/app/dev/commands/new_command.rb +9 -0
- data/app/dev/commands/new_command_test.rb +7 -0
- 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/dev_box.rb +13 -0
- data/app/happy/axos/axo.rb +50 -0
- data/app/happy_box.rb +8 -0
- data/app/net/databases/redis_db.rb +5 -0
- data/app/net/databases/redis_db_test.rb +12 -0
- data/app/net/databases/sqlite_db.rb +11 -0
- data/app/net/databases/sqlite_db_test.rb +12 -0
- data/app/net/models/app_model.rb +20 -0
- data/app/net/models/app_model_test.rb +8 -0
- data/app/net/models/post_model.rb +4 -0
- data/app/net/models/post_model_test.rb +8 -0
- data/app/net/models/user_model.rb +4 -0
- data/app/net/models/user_model_test.rb +8 -0
- data/app/net_box.rb +21 -0
- data/app/web/requests/api_request.rb +61 -0
- data/app/web/requests/api_request_test.rb +31 -0
- data/app/web/requests/app_request.rb +5 -0
- data/app/web/requests/app_request_test.rb +7 -0
- data/app/web/requests/assets_request.rb +71 -0
- data/app/web/requests/assets_request_test.rb +33 -0
- data/app/web/requests/root_request.rb +55 -0
- data/app/web/requests/root_request_test.rb +31 -0
- data/app/web_box.rb +8 -0
- data/app.code.env +11 -0
- data/app.env +11 -0
- data/app.rb +17 -0
- data/app_new/.gitignore +4 -0
- data/app_new/Gemfile +31 -0
- data/app_new/Procfile +3 -0
- data/exe/Gemfile +3 -0
- data/exe/Gemfile.lock +13 -0
- data/exe/liza +3 -0
- data/exe/lizarb +11 -0
- data/lib/app.rb +200 -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/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 +24 -0
- data/lib/dev_system/dev/controllers/command/dev_command_test.rb +14 -0
- data/lib/dev_system/dev/controllers/command/echo_command.rb +11 -0
- data/lib/dev_system/dev/controllers/command/echo_command_test.rb +14 -0
- 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/command/test_command.rb +70 -0
- data/lib/dev_system/dev/controllers/command/test_command_test.rb +14 -0
- data/lib/dev_system/dev/controllers/command/version_command.rb +9 -0
- data/lib/dev_system/dev/controllers/command/version_command_test.rb +14 -0
- data/lib/dev_system/dev/controllers/command.rb +19 -0
- data/lib/dev_system/dev/controllers/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 +22 -0
- data/lib/dev_system/dev/dev_box_test.rb +19 -0
- data/lib/dev_system/dev/panels/command_panel.rb +10 -0
- data/lib/dev_system/dev/panels/command_panel_test.rb +23 -0
- data/lib/dev_system/dev/panels/log_panel.rb +10 -0
- data/lib/dev_system/dev/panels/log_panel_test.rb +18 -0
- data/lib/dev_system.rb +8 -0
- data/lib/happy_system/dev/happy_command.rb +11 -0
- data/lib/happy_system/happy/controllers/axo.rb +8 -0
- data/lib/happy_system/happy/happy_box.rb +12 -0
- data/lib/happy_system/happy/happy_box_test.rb +18 -0
- data/lib/happy_system/happy/panels/axo_panel.rb +5 -0
- data/lib/{viral.rb → happy_system.rb} +7 -3
- data/lib/liza/base/box.rb +40 -0
- data/lib/liza/base/box_test.rb +12 -0
- data/lib/liza/base/controller.rb +27 -0
- data/lib/liza/base/controller_test.rb +12 -0
- data/lib/liza/base/panel.rb +38 -0
- data/lib/liza/base/panel_test.rb +16 -0
- data/lib/liza/meta/part.rb +19 -0
- data/lib/liza/meta/part_extension.rb +13 -0
- data/lib/liza/meta/part_test.rb +8 -0
- data/lib/liza/meta/system.rb +20 -0
- data/lib/liza/meta/system_test.rb +13 -0
- data/lib/liza/test/test.rb +11 -0
- data/lib/liza/test/test_test.rb +108 -0
- data/lib/liza/test_parts/test_assertions_part.rb +110 -0
- data/lib/liza/test_parts/test_context_part.rb +81 -0
- data/lib/liza/test_parts/test_dsl_part.rb +122 -0
- data/lib/liza/test_parts/test_subject_part.rb +24 -0
- data/lib/liza/unit.rb +149 -0
- data/lib/liza/unit_test.rb +79 -0
- data/lib/liza.rb +62 -0
- data/lib/lizarb/ruby/class.rb +17 -0
- data/lib/lizarb/ruby/proc.rb +12 -0
- data/lib/lizarb/ruby/string.rb +25 -0
- data/lib/lizarb/ruby/time.rb +9 -0
- data/lib/{viral → lizarb}/version.rb +2 -2
- data/lib/lizarb.rb +68 -0
- data/lib/net_system/dev/net_command.rb +24 -0
- data/lib/net_system/net/controllers/client/redis_client.rb +28 -0
- data/lib/net_system/net/controllers/client/redis_client_test.rb +29 -0
- data/lib/net_system/net/controllers/client/sqlite_client.rb +28 -0
- data/lib/net_system/net/controllers/client/sqlite_client_test.rb +29 -0
- data/lib/net_system/net/controllers/client.rb +5 -0
- data/lib/net_system/net/controllers/client_test.rb +14 -0
- data/lib/net_system/net/controllers/database/redis_db.rb +11 -0
- data/lib/net_system/net/controllers/database/redis_db_test.rb +23 -0
- data/lib/net_system/net/controllers/database/sqlite_db.rb +11 -0
- data/lib/net_system/net/controllers/database/sqlite_db_test.rb +23 -0
- data/lib/net_system/net/controllers/database.rb +33 -0
- data/lib/net_system/net/controllers/database_test.rb +14 -0
- data/lib/net_system/net/controllers/model.rb +31 -0
- data/lib/net_system/net/controllers/model_test.rb +14 -0
- data/lib/net_system/net/net_box.rb +20 -0
- data/lib/net_system/net/net_box_test.rb +19 -0
- data/lib/net_system/net/panels/client_panel.rb +5 -0
- data/lib/net_system/net/panels/client_panel_test.rb +18 -0
- data/lib/net_system/net/panels/database_panel.rb +12 -0
- data/lib/net_system/net/panels/database_panel_test.rb +18 -0
- data/lib/net_system.rb +3 -0
- data/lib/web_system/dev/web_command.rb +42 -0
- data/lib/web_system/web/controllers/request/client_error_request.rb +18 -0
- data/lib/web_system/web/controllers/request/not_found_request.rb +18 -0
- data/lib/web_system/web/controllers/request/server_error_request.rb +20 -0
- data/lib/web_system/web/controllers/request.rb +5 -0
- data/lib/web_system/web/controllers/request_test.rb +18 -0
- data/lib/web_system/web/panels/request_panel.rb +55 -0
- data/lib/web_system/web/panels/request_panel_test.rb +14 -0
- data/lib/web_system/web/web_box.rb +12 -0
- data/lib/web_system/web/web_box_test.rb +18 -0
- data/lib/web_system.rb +5 -0
- data/lizarb.gemspec +44 -0
- data/sig/{viral.rbs → lizarb.rbs} +1 -1
- data/tmp/.gitkeep +0 -0
- data/web_files/favicon.ico +0 -0
- data/web_files/favicon.svg +948 -0
- metadata +226 -13
- data/viral.gemspec +0 -45
@@ -0,0 +1,33 @@
|
|
1
|
+
class NetSystem
|
2
|
+
class Database < Liza::Controller
|
3
|
+
|
4
|
+
def self.inherited sub
|
5
|
+
super
|
6
|
+
|
7
|
+
return if sub.name.nil?
|
8
|
+
return if sub.name.end_with? "Db"
|
9
|
+
raise "please rename #{sub.name} to #{sub.name}Db"
|
10
|
+
end
|
11
|
+
|
12
|
+
attr_reader :client
|
13
|
+
|
14
|
+
def initialize client: get(:client).new
|
15
|
+
@client = client
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.set_client client_id
|
19
|
+
set :client, Liza.const("#{client_id}_client")
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.current
|
23
|
+
Thread.current[last_namespace] ||= begin
|
24
|
+
log "Connecting to #{last_namespace}"
|
25
|
+
new
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.call(...); current.call(...); end
|
30
|
+
def call(...); @client.call(...); end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class NetSystem
|
2
|
+
class DatabaseTest < Liza::ControllerTest
|
3
|
+
|
4
|
+
test :subject_class do
|
5
|
+
assert subject_class == NetSystem::Database
|
6
|
+
end
|
7
|
+
|
8
|
+
test :settings do
|
9
|
+
assert subject_class.log_level == :normal
|
10
|
+
assert subject_class.log_color == :red
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,31 @@
|
|
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
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class NetSystem
|
2
|
+
class ModelTest < Liza::ControllerTest
|
3
|
+
|
4
|
+
test :subject_class do
|
5
|
+
assert subject_class == NetSystem::Model
|
6
|
+
end
|
7
|
+
|
8
|
+
test :settings do
|
9
|
+
assert subject_class.log_level == :normal
|
10
|
+
assert subject_class.log_color == :red
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class NetSystem
|
2
|
+
class NetBox < Liza::Box
|
3
|
+
has_panel :client, :clients
|
4
|
+
has_controller :client, :clients
|
5
|
+
|
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
|
+
end
|
10
|
+
|
11
|
+
has_panel :database, :databases
|
12
|
+
has_controller :database, :databases
|
13
|
+
|
14
|
+
# Set up your database panel per the DSL in http://guides.lizarb.org/panels/database.html
|
15
|
+
databases do
|
16
|
+
# set :log_level, ENV["net.database.log_level"]
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class NetSystem
|
2
|
+
class NetBoxTest < Liza::BoxTest
|
3
|
+
|
4
|
+
test :subject_class do
|
5
|
+
assert subject_class == NetSystem::NetBox
|
6
|
+
end
|
7
|
+
|
8
|
+
test :settings do
|
9
|
+
assert subject_class.log_level == :normal
|
10
|
+
assert subject_class.log_color == :red
|
11
|
+
end
|
12
|
+
|
13
|
+
test :panels do
|
14
|
+
assert subject_class.clients.is_a? ClientPanel
|
15
|
+
assert subject_class.databases.is_a? DatabasePanel
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class NetSystem
|
2
|
+
class ClientPanelTest < Liza::PanelTest
|
3
|
+
|
4
|
+
test :subject_class do
|
5
|
+
assert subject_class == NetSystem::ClientPanel
|
6
|
+
end
|
7
|
+
|
8
|
+
test :settings do
|
9
|
+
assert subject_class.log_level == :normal
|
10
|
+
assert subject_class.log_color == :red
|
11
|
+
end
|
12
|
+
|
13
|
+
# test :call do
|
14
|
+
# todo "write this"
|
15
|
+
# end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class NetSystem
|
2
|
+
class DatabasePanelTest < Liza::PanelTest
|
3
|
+
|
4
|
+
test :subject_class do
|
5
|
+
assert subject_class == NetSystem::DatabasePanel
|
6
|
+
end
|
7
|
+
|
8
|
+
test :settings do
|
9
|
+
assert subject_class.log_level == :normal
|
10
|
+
assert subject_class.log_color == :red
|
11
|
+
end
|
12
|
+
|
13
|
+
# test :call do
|
14
|
+
# todo "write this"
|
15
|
+
# end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
data/lib/net_system.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
class WebSystem
|
2
|
+
class WebCommand < Liza::Command
|
3
|
+
|
4
|
+
set :files, App.root.join("web_files")
|
5
|
+
set :host, "localhost"
|
6
|
+
set :port, 3000
|
7
|
+
|
8
|
+
def self.call args
|
9
|
+
log :higher, "Called #{self} with args #{args}"
|
10
|
+
|
11
|
+
host = get :host
|
12
|
+
port = get :port
|
13
|
+
|
14
|
+
args.each do |arg|
|
15
|
+
host = arg.split("=")[1] if arg.start_with? "h="
|
16
|
+
port = arg.split("=")[1] if arg.start_with? "p="
|
17
|
+
end
|
18
|
+
|
19
|
+
if App.mode == :code
|
20
|
+
ENV["RACK_ENV"] = "development"
|
21
|
+
rack_app = method :_call
|
22
|
+
else
|
23
|
+
ENV["RACK_ENV"] = "production"
|
24
|
+
rack_app = ::WebBox.requests
|
25
|
+
end
|
26
|
+
|
27
|
+
rack_files = Rack::Files.new get(:files)
|
28
|
+
rack_app = Rack::Cascade.new [rack_files, rack_app]
|
29
|
+
|
30
|
+
require "rack/handler/puma"
|
31
|
+
Rack::Handler::Puma.run rack_app, Host: host, Port: port
|
32
|
+
end
|
33
|
+
|
34
|
+
def self._call app
|
35
|
+
App.reload do
|
36
|
+
log "reloading"
|
37
|
+
return ::WebBox.requests.call app
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class WebSystem
|
2
|
+
class ClientErrorRequest < Request
|
3
|
+
|
4
|
+
def self.call env
|
5
|
+
status = 400
|
6
|
+
|
7
|
+
headers = {
|
8
|
+
"Framework" => "Liza #{Lizarb::VERSION}"
|
9
|
+
}
|
10
|
+
|
11
|
+
body = "Client Error #{status} - #{env["LIZA_PATH"]}"
|
12
|
+
|
13
|
+
log status
|
14
|
+
[status, headers, [body]]
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class WebSystem
|
2
|
+
class NotFoundRequest < Request
|
3
|
+
|
4
|
+
def self.call env
|
5
|
+
status = 404
|
6
|
+
|
7
|
+
headers = {
|
8
|
+
"Framework" => "Liza #{Lizarb::VERSION}"
|
9
|
+
}
|
10
|
+
|
11
|
+
body = "Client Error #{status} - #{env["LIZA_PATH"]}"
|
12
|
+
|
13
|
+
log status
|
14
|
+
[status, headers, [body]]
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class WebSystem
|
2
|
+
class ServerErrorRequest < Request
|
3
|
+
|
4
|
+
def self.call env
|
5
|
+
status = 500
|
6
|
+
|
7
|
+
headers = {
|
8
|
+
"Framework" => "Liza #{Lizarb::VERSION}"
|
9
|
+
}
|
10
|
+
|
11
|
+
e = env["LIZA_ERROR"]
|
12
|
+
|
13
|
+
body = "Server Error #{status} - #{e.class} - #{e.message}"
|
14
|
+
|
15
|
+
log status
|
16
|
+
[status, headers, [body]]
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class WebSystem
|
2
|
+
class RequestTest < Liza::ControllerTest
|
3
|
+
|
4
|
+
test :subject_class do
|
5
|
+
assert subject_class == WebSystem::Request
|
6
|
+
end
|
7
|
+
|
8
|
+
test :settings do
|
9
|
+
assert subject_class.log_level == :normal
|
10
|
+
assert subject_class.log_color == :blue
|
11
|
+
end
|
12
|
+
|
13
|
+
# test :call do
|
14
|
+
# todo "write this"
|
15
|
+
# end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
class WebSystem
|
2
|
+
class RequestPanel < Liza::Panel
|
3
|
+
|
4
|
+
def call env
|
5
|
+
puts
|
6
|
+
|
7
|
+
# 1. LOG GET /
|
8
|
+
|
9
|
+
log "#{env["REQUEST_METHOD"]} #{env["REQUEST_PATH"]}"
|
10
|
+
|
11
|
+
# 2. PREPARE env
|
12
|
+
|
13
|
+
path = env["REQUEST_PATH"]
|
14
|
+
|
15
|
+
path, _sep, format = path.lpartition "."
|
16
|
+
format = "html" if format.empty?
|
17
|
+
|
18
|
+
segments = Array path.split("/")[1..-1]
|
19
|
+
|
20
|
+
case segments.count
|
21
|
+
when 0
|
22
|
+
request, action = "root", "root"
|
23
|
+
when 1
|
24
|
+
request, action = "root", segments[0]
|
25
|
+
else
|
26
|
+
request, action = segments[0..1]
|
27
|
+
end
|
28
|
+
|
29
|
+
env["LIZA_PATH"] = path
|
30
|
+
env["LIZA_REQUEST"] = request
|
31
|
+
env["LIZA_ACTION"] = action
|
32
|
+
env["LIZA_FORMAT"] = format
|
33
|
+
|
34
|
+
log({request:, action:, format:})
|
35
|
+
|
36
|
+
# 3. FIND request
|
37
|
+
|
38
|
+
begin
|
39
|
+
request_klass = Liza.const "#{request}_request"
|
40
|
+
rescue NameError
|
41
|
+
request_klass = NotFoundRequest
|
42
|
+
end
|
43
|
+
|
44
|
+
# 4. CALL
|
45
|
+
|
46
|
+
request_klass.call env
|
47
|
+
rescue => e
|
48
|
+
request_klass = ServerErrorRequest
|
49
|
+
env["LIZA_ERROR"] = e
|
50
|
+
|
51
|
+
request_klass.call env
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class WebSystem
|
2
|
+
class WebBox < Liza::Box
|
3
|
+
has_panel :request, :requests
|
4
|
+
has_controller :request, :requests
|
5
|
+
|
6
|
+
# Set up your request panel per the DSL in http://guides.lizarb.org/panels/request.html
|
7
|
+
requests do
|
8
|
+
# set :log_level, ENV["web.request.log_level"]
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class WebSystem
|
2
|
+
class WebBoxTest < Liza::BoxTest
|
3
|
+
|
4
|
+
test :subject_class do
|
5
|
+
assert subject_class == WebSystem::WebBox
|
6
|
+
end
|
7
|
+
|
8
|
+
test :settings do
|
9
|
+
assert subject_class.log_level == :normal
|
10
|
+
assert subject_class.log_color == :blue
|
11
|
+
end
|
12
|
+
|
13
|
+
test :panels do
|
14
|
+
assert subject_class.requests.is_a? RequestPanel
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
data/lib/web_system.rb
ADDED
data/lizarb.gemspec
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/lizarb/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "lizarb"
|
7
|
+
spec.version = Lizarb::VERSION
|
8
|
+
spec.authors = "Thiago Pinto"
|
9
|
+
spec.email = "thiagopintodev@gmail.com"
|
10
|
+
|
11
|
+
spec.summary = "Application Framework"
|
12
|
+
spec.description = "Liza is a light, experimental framework primarily developed to help study the Ruby language and the Ruby ecosystem."
|
13
|
+
spec.homepage = "http://lizarb.org"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 3.1.0"
|
16
|
+
|
17
|
+
spec.metadata = {
|
18
|
+
"homepage_uri" => "https://github.com/rubyonrails-brasil/lizarb",
|
19
|
+
"changelog_uri" => "https://github.com/rubyonrails-brasil/lizarb/blob/main/CHANGELOG.md",
|
20
|
+
"source_code_uri" => "https://github.com/rubyonrails-brasil/lizarb",
|
21
|
+
"bug_tracker_uri" => "https://github.com/rubyonrails-brasil/lizarb/issues"
|
22
|
+
}
|
23
|
+
|
24
|
+
# Specify which files should be added to the gem when it is released.
|
25
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
26
|
+
spec.files = Dir.chdir(__dir__) do
|
27
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
28
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
29
|
+
end
|
30
|
+
end
|
31
|
+
spec.bindir = "exe"
|
32
|
+
spec.executables = ["liza", "lizarb"]
|
33
|
+
spec.require_paths = ["lib"]
|
34
|
+
|
35
|
+
# dependencies
|
36
|
+
|
37
|
+
spec.add_dependency "colorize", "~> 0.8"
|
38
|
+
spec.add_dependency "dotenv", "~> 2.8"
|
39
|
+
spec.add_dependency "zeitwerk", "~> 2.6"
|
40
|
+
|
41
|
+
# development dependencies
|
42
|
+
|
43
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
44
|
+
end
|
data/tmp/.gitkeep
ADDED
File without changes
|
Binary file
|