lizarb 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/app/dev_box.rb +24 -4
  4. data/app/happy_box.rb +1 -1
  5. data/app/net/databases/sqlite_db_test.rb +5 -5
  6. data/app/net/records/app_record_test.rb +1 -1
  7. data/app/net/records/post_record_test.rb +1 -1
  8. data/app/net/records/user_record_test.rb +1 -1
  9. data/app/net_box.rb +7 -7
  10. data/app/web_box.rb +2 -2
  11. data/lib/app.rb +1 -1
  12. data/lib/dev_system/dev/controllers/bench/not_found_bench.rb +17 -19
  13. data/lib/dev_system/dev/controllers/bench/not_found_bench_test.rb +9 -11
  14. data/lib/dev_system/dev/controllers/bench.rb +5 -7
  15. data/lib/dev_system/dev/controllers/bench_dsl_main_part.rb +37 -39
  16. data/lib/dev_system/dev/controllers/bench_test.rb +8 -10
  17. data/lib/dev_system/dev/controllers/command/bench_command.rb +20 -22
  18. data/lib/dev_system/dev/controllers/command/bench_command_test.rb +8 -10
  19. data/lib/dev_system/dev/controllers/command/echo_command.rb +5 -7
  20. data/lib/dev_system/dev/controllers/command/echo_command_test.rb +8 -10
  21. data/lib/dev_system/dev/controllers/command/generate_command.rb +20 -22
  22. data/lib/dev_system/dev/controllers/command/generate_command_test.rb +8 -10
  23. data/lib/dev_system/dev/controllers/command/not_found_command.rb +17 -19
  24. data/lib/dev_system/dev/controllers/command/not_found_command_test.rb +8 -10
  25. data/lib/dev_system/dev/controllers/command/terminal_command.rb +12 -14
  26. data/lib/dev_system/dev/controllers/command/terminal_command_test.rb +8 -10
  27. data/lib/dev_system/dev/controllers/command/test_command.rb +64 -53
  28. data/lib/dev_system/dev/controllers/command/test_command_test.rb +8 -10
  29. data/lib/dev_system/dev/controllers/command/version_command.rb +4 -6
  30. data/lib/dev_system/dev/controllers/command/version_command_test.rb +8 -10
  31. data/lib/dev_system/dev/controllers/command.rb +11 -13
  32. data/lib/dev_system/dev/controllers/command_test.rb +8 -10
  33. data/lib/dev_system/dev/controllers/generator.rb +5 -7
  34. data/lib/dev_system/dev/controllers/generator_dsl_main_part.rb +35 -37
  35. data/lib/dev_system/dev/controllers/generator_test.rb +8 -10
  36. data/lib/dev_system/dev/controllers/generators/app_generator.rb +103 -53
  37. data/lib/dev_system/dev/controllers/generators/app_generator_test.rb +8 -10
  38. data/lib/dev_system/dev/controllers/generators/not_found_generator.rb +17 -19
  39. data/lib/dev_system/dev/controllers/generators/not_found_generator_test.rb +8 -10
  40. data/lib/dev_system/dev/controllers/terminal/irb_terminal.rb +11 -13
  41. data/lib/dev_system/dev/controllers/terminal/irb_terminal_test.rb +8 -10
  42. data/lib/dev_system/dev/controllers/terminal/pry_terminal.rb +6 -8
  43. data/lib/dev_system/dev/controllers/terminal/pry_terminal_test.rb +8 -10
  44. data/lib/dev_system/dev/controllers/terminal.rb +11 -13
  45. data/lib/dev_system/dev/controllers/terminal_test.rb +8 -10
  46. data/lib/dev_system/dev/dev_box.rb +33 -16
  47. data/lib/dev_system/dev/dev_box_test.rb +12 -14
  48. data/lib/dev_system/dev/panels/bench_panel.rb +3 -0
  49. data/lib/dev_system/dev/panels/bench_panel_test.rb +12 -0
  50. data/lib/dev_system/dev/panels/command_panel.rb +16 -18
  51. data/lib/dev_system/dev/panels/command_panel_test.rb +15 -17
  52. data/lib/dev_system/dev/panels/generator_panel.rb +3 -0
  53. data/lib/dev_system/dev/panels/generator_panel_test.rb +12 -0
  54. data/lib/dev_system/dev/panels/log_panel.rb +9 -6
  55. data/lib/dev_system/dev/panels/log_panel_test.rb +11 -13
  56. data/lib/dev_system/dev/panels/shell_panel.rb +3 -0
  57. data/lib/dev_system/dev/panels/shell_panel_test.rb +12 -0
  58. data/lib/dev_system/dev/panels/terminal_panel.rb +3 -0
  59. data/lib/dev_system/dev/panels/terminal_panel_test.rb +12 -0
  60. data/lib/happy_system/happy/controllers/axo.rb +4 -5
  61. data/lib/happy_system/happy/happy_box.rb +6 -9
  62. data/lib/happy_system/happy/happy_box_test.rb +11 -13
  63. data/lib/happy_system/happy/panels/axo_panel.rb +1 -3
  64. data/lib/liza/base/box.rb +71 -26
  65. data/lib/liza/base/box_test.rb +7 -9
  66. data/lib/liza/base/controller.rb +19 -21
  67. data/lib/liza/base/controller_test.rb +7 -9
  68. data/lib/liza/base/panel.rb +42 -27
  69. data/lib/liza/base/panel_test.rb +10 -12
  70. data/lib/liza/meta/part.rb +12 -14
  71. data/lib/liza/meta/part_extension.rb +14 -16
  72. data/lib/liza/meta/part_test.rb +4 -6
  73. data/lib/liza/meta/system.rb +12 -14
  74. data/lib/liza/meta/system_test.rb +8 -10
  75. data/lib/liza/ruby_test.rb +4 -6
  76. data/lib/liza/ruby_tests/module_test.rb +1 -1
  77. data/lib/liza/test/test.rb +7 -10
  78. data/lib/liza/test/test_test.rb +158 -159
  79. data/lib/liza/test_parts/test_assertions_advanced_part.rb +102 -104
  80. data/lib/liza/test_parts/test_assertions_part.rb +81 -83
  81. data/lib/liza/test_parts/test_dsl_part.rb +47 -49
  82. data/lib/liza/test_parts/test_log_part.rb +88 -90
  83. data/lib/liza/test_parts/test_subject_part.rb +16 -18
  84. data/lib/liza/test_parts/test_tree_part.rb +105 -107
  85. data/lib/liza/unit.rb +108 -104
  86. data/lib/liza/unit_test.rb +69 -71
  87. data/lib/lizarb/version.rb +1 -1
  88. data/lib/net_system/dev/net_command.rb +10 -12
  89. data/lib/net_system/net/controllers/client/redis_client.rb +19 -21
  90. data/lib/net_system/net/controllers/client/redis_client_test.rb +20 -22
  91. data/lib/net_system/net/controllers/client/sqlite_client.rb +19 -21
  92. data/lib/net_system/net/controllers/client/sqlite_client_test.rb +20 -22
  93. data/lib/net_system/net/controllers/client.rb +1 -3
  94. data/lib/net_system/net/controllers/client_test.rb +8 -10
  95. data/lib/net_system/net/controllers/database/redis_db.rb +6 -8
  96. data/lib/net_system/net/controllers/database/redis_db_test.rb +15 -17
  97. data/lib/net_system/net/controllers/database/sqlite_db.rb +6 -8
  98. data/lib/net_system/net/controllers/database/sqlite_db_test.rb +15 -17
  99. data/lib/net_system/net/controllers/database.rb +21 -23
  100. data/lib/net_system/net/controllers/database_test.rb +8 -10
  101. data/lib/net_system/net/controllers/record.rb +21 -23
  102. data/lib/net_system/net/controllers/record_test.rb +8 -10
  103. data/lib/net_system/net/net_box.rb +11 -16
  104. data/lib/net_system/net/net_box_test.rb +12 -14
  105. data/lib/net_system/net/panels/client_panel.rb +1 -3
  106. data/lib/net_system/net/panels/client_panel_test.rb +11 -13
  107. data/lib/net_system/net/panels/database_panel.rb +6 -8
  108. data/lib/net_system/net/panels/database_panel_test.rb +11 -13
  109. data/lib/web_system/dev/rack_command.rb +26 -17
  110. data/lib/web_system/dev/request_command.rb +2 -2
  111. data/lib/web_system/dev/web_command.rb +6 -8
  112. data/lib/web_system/web/controllers/rack.rb +4 -6
  113. data/lib/web_system/web/controllers/rack_test.rb +11 -13
  114. data/lib/web_system/web/controllers/request/client_error_request.rb +9 -11
  115. data/lib/web_system/web/controllers/request/not_found_request.rb +9 -11
  116. data/lib/web_system/web/controllers/request/server_error_request.rb +10 -12
  117. data/lib/web_system/web/controllers/request.rb +1 -3
  118. data/lib/web_system/web/controllers/request_test.rb +11 -13
  119. data/lib/web_system/web/panels/rack_panel.rb +37 -39
  120. data/lib/web_system/web/panels/rack_panel_test.rb +8 -10
  121. data/lib/web_system/web/panels/request_panel.rb +54 -56
  122. data/lib/web_system/web/panels/request_panel_test.rb +1 -1
  123. data/lib/web_system/web/web_box.rb +14 -18
  124. data/lib/web_system/web/web_box_test.rb +11 -13
  125. metadata +10 -5
  126. data/app_new/.gitignore +0 -4
  127. data/app_new/Gemfile +0 -31
  128. data/app_new/Procfile +0 -3
@@ -1,24 +1,22 @@
1
- class DevSystem
2
- class TerminalCommand < Command
1
+ class DevSystem::TerminalCommand < DevSystem::Command
3
2
 
4
- def self.call args
5
- # 1. LOG
3
+ def self.call args
4
+ # 1. LOG
6
5
 
7
- log :higher, "args: #{args}"
8
- puts
6
+ log :higher, "args: #{args}"
7
+ puts
9
8
 
10
- # 2. FIND terminal
9
+ # 2. FIND terminal
11
10
 
12
- terminal = args[0] || "irb"
11
+ terminal = args[0] || "irb"
13
12
 
14
- log({terminal:})
13
+ log({terminal:})
15
14
 
16
- terminal_klass = Liza.const "#{terminal}_terminal"
15
+ terminal_klass = Liza.const "#{terminal}_terminal"
17
16
 
18
- # 3. CALL
19
-
20
- terminal_klass.call Array(args[1..-1])
21
- end
17
+ # 3. CALL
22
18
 
19
+ terminal_klass.call Array(args[1..-1])
23
20
  end
21
+
24
22
  end
@@ -1,14 +1,12 @@
1
- class DevSystem
2
- class TerminalCommandTest < CommandTest
1
+ class DevSystem::TerminalCommandTest < DevSystem::CommandTest
3
2
 
4
- test :subject_class do
5
- assert subject_class == DevSystem::TerminalCommand
6
- end
7
-
8
- test :settings do
9
- assert subject_class.log_level == :normal
10
- assert subject_class.log_color == :green
11
- end
3
+ test :subject_class do
4
+ assert subject_class == DevSystem::TerminalCommand
5
+ end
12
6
 
7
+ test :settings do
8
+ assert subject_class.log_level == :normal
9
+ assert subject_class.log_color == :green
13
10
  end
11
+
14
12
  end
@@ -1,74 +1,85 @@
1
- class DevSystem
2
- class TestCommand < Command
1
+ class DevSystem::TestCommand < DevSystem::Command
3
2
 
4
- def self.call args
5
- log :higher, "Called #{self} with args #{args}"
3
+ def self.call args
4
+ log :higher, "Called #{self} with args #{args}"
6
5
 
7
- App.eager_load_all
6
+ App.eager_load_all
8
7
 
9
- now = Time.now
10
- test_classes = Liza::Test.descendants
11
-
12
- if Lizarb::IS_APP_DIR
13
- test_classes = test_classes.select { |tc| tc.source_location[0].include? Lizarb::APP_DIR }
14
- end
8
+ now = Time.now
9
+ test_classes = Liza::Test.descendants
10
+
11
+ _call_silence_base_units
12
+
13
+ if Lizarb::IS_APP_DIR
14
+ test_classes = test_classes.select { |tc| tc.source_location[0].include? Lizarb::APP_DIR }
15
+ end
15
16
 
16
- test_classes = _call_sort test_classes
17
+ test_classes = _call_sort test_classes
17
18
 
18
- log "Testing #{test_classes}"
19
- _call_testing test_classes
20
- log "Done Testing (#{now.diff}s)"
19
+ log "Testing #{test_classes}"
20
+ _call_testing test_classes
21
+ log "Done Testing (#{now.diff}s)"
21
22
 
22
- puts
23
+ puts
23
24
 
24
- log "Counting #{test_classes.count} Test Classes"
25
- _call_counting test_classes
26
- log "Done Counting (#{now.diff}s)"
25
+ log "Counting #{test_classes.count} Test Classes"
26
+ _call_counting test_classes
27
+ log "Done Counting (#{now.diff}s)"
28
+ end
29
+
30
+ def self._call_silence_base_units
31
+ [
32
+ Liza::Box,
33
+ Liza::Panel,
34
+ Liza::Controller,
35
+ ].each do |x|
36
+ def x.log(...) end
37
+ def x.puts(...) end
27
38
  end
39
+ end
28
40
 
29
- def self._call_sort test_classes
30
- test_classes.sort_by! &:name
41
+ def self._call_sort test_classes
42
+ test_classes.sort_by! &:name
31
43
 
32
- proc_namespaced = proc { |tc| tc.name.include? "::" }
33
- proc_liza = proc { |tc| tc.name[0..3] == "Liza" }
44
+ proc_namespaced = proc { |tc| tc.name.include? "::" }
45
+ proc_liza = proc { |tc| tc.name[0..3] == "Liza" }
34
46
 
35
- tc_app = test_classes.reject &proc_namespaced
36
- tc_namespaced = test_classes.select &proc_namespaced
47
+ tc_app = test_classes.reject &proc_namespaced
48
+ tc_namespaced = test_classes.select &proc_namespaced
37
49
 
38
- tc_liza = tc_namespaced.select &proc_liza
39
- tc_system = tc_namespaced.reject &proc_liza
50
+ tc_liza = tc_namespaced.select &proc_liza
51
+ tc_system = tc_namespaced.reject &proc_liza
40
52
 
41
- tc_app.sort_by! &:source_location
42
- tc_liza.sort_by! &:source_location
53
+ tc_app.sort_by! &:source_location
54
+ tc_liza.sort_by! &:source_location
43
55
 
44
- [tc_liza, tc_system, tc_app].flatten
45
- end
56
+ [tc_liza, tc_system, tc_app].flatten
57
+ end
46
58
 
47
- def self._call_testing test_classes
48
- i, count = 0, test_classes.count
49
- for test_class in test_classes
50
- test_class.call i+=1, count
51
- end
59
+ def self._call_testing test_classes
60
+ i, count = 0, test_classes.count
61
+ for test_class in test_classes
62
+ test_class.call i+=1, count
52
63
  end
64
+ end
53
65
 
54
- def self._call_counting test_classes
55
- puts
56
- totals = Hash.new { 0 }
57
- last_namespace = nil
58
- test_classes.each do |test_class|
59
- namespace = test_class.first_namespace
60
- puts if last_namespace != namespace
61
- last_namespace = namespace
62
-
63
- test_class.totals.each do |k, v|
64
- totals[k] += v.size
65
- end
66
- Liza.log " #{"#{test_class}.totals".ljust 60} #{test_class.totals.map { |k, v| [k, v.size] }.to_h}"
66
+ def self._call_counting test_classes
67
+ puts
68
+ totals = Hash.new { 0 }
69
+ last_namespace = nil
70
+ test_classes.each do |test_class|
71
+ namespace = test_class.first_namespace
72
+ puts if last_namespace != namespace
73
+ last_namespace = namespace
74
+
75
+ test_class.totals.each do |k, v|
76
+ totals[k] += v.size
67
77
  end
68
- puts
69
- Liza.log " #{"Total".ljust 60} #{totals}"
70
- puts
78
+ Liza.log " #{"#{test_class}.totals".ljust 60} #{test_class.totals.map { |k, v| [k, v.size] }.to_h}"
71
79
  end
72
-
80
+ puts
81
+ Liza.log " #{"Total".ljust 60} #{totals}"
82
+ puts
73
83
  end
84
+
74
85
  end
@@ -1,14 +1,12 @@
1
- class DevSystem
2
- class TestCommandTest < CommandTest
1
+ class DevSystem::TestCommandTest < DevSystem::CommandTest
3
2
 
4
- test :subject_class do
5
- assert subject_class == DevSystem::TestCommand
6
- end
7
-
8
- test :settings do
9
- assert subject_class.log_level == :normal
10
- assert subject_class.log_color == :green
11
- end
3
+ test :subject_class do
4
+ assert subject_class == DevSystem::TestCommand
5
+ end
12
6
 
7
+ test :settings do
8
+ assert subject_class.log_level == :normal
9
+ assert subject_class.log_color == :green
13
10
  end
11
+
14
12
  end
@@ -1,9 +1,7 @@
1
- class DevSystem
2
- class VersionCommand < Command
3
-
4
- def self.call args
5
- puts Lizarb::VERSION
6
- end
1
+ class DevSystem::VersionCommand < DevSystem::Command
7
2
 
3
+ def self.call args
4
+ puts Lizarb::VERSION
8
5
  end
6
+
9
7
  end
@@ -1,14 +1,12 @@
1
- class DevSystem
2
- class VersionCommandTest < CommandTest
1
+ class DevSystem::VersionCommandTest < DevSystem::CommandTest
3
2
 
4
- test :subject_class do
5
- assert subject_class == DevSystem::VersionCommand
6
- end
7
-
8
- test :settings do
9
- assert subject_class.log_level == :normal
10
- assert subject_class.log_color == :green
11
- end
3
+ test :subject_class do
4
+ assert subject_class == DevSystem::VersionCommand
5
+ end
12
6
 
7
+ test :settings do
8
+ assert subject_class.log_level == :normal
9
+ assert subject_class.log_color == :green
13
10
  end
11
+
14
12
  end
@@ -1,19 +1,17 @@
1
- class DevSystem
2
- class Command < Liza::Controller
1
+ class DevSystem::Command < Liza::Controller
3
2
 
4
- # def self.call args
5
- # new.call args
6
- # end
3
+ # def self.call args
4
+ # new.call args
5
+ # end
7
6
 
8
- # def initialize args
9
- # @args = args
10
- # end
7
+ # def initialize args
8
+ # @args = args
9
+ # end
11
10
 
12
- # attr_reader :args
11
+ # attr_reader :args
13
12
 
14
- # def call args
15
- #
16
- # end
13
+ # def call args
14
+ #
15
+ # end
17
16
 
18
- end
19
17
  end
@@ -1,14 +1,12 @@
1
- class DevSystem
2
- class CommandTest < Liza::ControllerTest
1
+ class DevSystem::CommandTest < Liza::ControllerTest
3
2
 
4
- test :subject_class do
5
- assert subject_class == DevSystem::Command
6
- end
7
-
8
- test :settings do
9
- assert subject_class.log_level == :normal
10
- assert subject_class.log_color == :green
11
- end
3
+ test :subject_class do
4
+ assert subject_class == DevSystem::Command
5
+ end
12
6
 
7
+ test :settings do
8
+ assert subject_class.log_level == :normal
9
+ assert subject_class.log_color == :green
13
10
  end
11
+
14
12
  end
@@ -1,11 +1,9 @@
1
- class DevSystem
2
- class Generator < Liza::Controller
1
+ class DevSystem::Generator < Liza::Controller
3
2
 
4
- # DSLS
5
-
6
- def self.main_dsl
7
- part :"generator_dsl_main", system: :dev
8
- end
3
+ # DSLS
9
4
 
5
+ def self.main_dsl
6
+ part :"generator_dsl_main", system: :dev
10
7
  end
8
+
11
9
  end
@@ -1,54 +1,52 @@
1
- class DevSystem
2
- class GeneratorDslMainPart < Liza::Part
1
+ class DevSystem::GeneratorDslMainPart < Liza::Part
3
2
 
4
- insertion do
3
+ insertion do
5
4
 
6
- def self.call args
7
- log :higher, "Called #{self}.#{__method__} with args #{args}"
5
+ def self.call args
6
+ log :higher, "Called #{self}.#{__method__} with args #{args}"
8
7
 
9
- name = args.shift || raise("args[0] should contain NAME")
10
- name = name.downcase
8
+ name = args.shift || raise("args[0] should contain NAME")
9
+ name = name.downcase
11
10
 
12
- memo.each do |label, bl|
13
- log "Generating #{label}"
14
- g = new label, name, args
15
- g.instance_exec &bl
16
- g.call
17
- end
18
-
19
- puts
20
- log "done"
11
+ memo.each do |label, bl|
12
+ log "Generating #{label}"
13
+ g = new label, name, args
14
+ g.instance_exec &bl
15
+ g.call
21
16
  end
22
17
 
23
- def self.memo()= @memo ||= {}
18
+ puts
19
+ log "done"
20
+ end
24
21
 
25
- def self.generate(label, &block)= memo[label] = block
22
+ def self.memo()= @memo ||= {}
26
23
 
27
- attr_reader :label, :name, :args
24
+ def self.generate(label, &block)= memo[label] = block
28
25
 
29
- def initialize label, name, args
30
- @label, @name, @args = label, name, args
31
- end
26
+ attr_reader :label, :name, :args
32
27
 
33
- def call
34
- TextShell.write "#{folder}/#{filename}", "#{content}\n"
35
- end
28
+ def initialize label, name, args
29
+ @label, @name, @args = label, name, args
30
+ end
36
31
 
37
- %w|folder filename content|.each do |s|
38
- class_eval <<-CODE, __FILE__, __LINE__ + 1
39
- attr_reader :#{s}
32
+ def call
33
+ TextShell.write "#{folder}/#{filename}", "#{content}\n"
34
+ end
40
35
 
41
- def #{s} #{s} = nil
42
- if #{s}
43
- @#{s} = #{s}
44
- else
45
- @#{s}
46
- end
47
- end
48
- CODE
49
- end
36
+ %w|folder filename content|.each do |s|
37
+ class_eval <<-CODE, __FILE__, __LINE__ + 1
38
+ attr_reader :#{s}
50
39
 
40
+ def #{s} #{s} = nil
41
+ if #{s}
42
+ @#{s} = #{s}
43
+ else
44
+ @#{s}
45
+ end
46
+ end
47
+ CODE
51
48
  end
52
49
 
53
50
  end
51
+
54
52
  end
@@ -1,14 +1,12 @@
1
- class DevSystem
2
- class GeneratorTest < Liza::ControllerTest
1
+ class DevSystem::GeneratorTest < Liza::ControllerTest
3
2
 
4
- test :subject_class do
5
- assert subject_class == DevSystem::Generator
6
- end
7
-
8
- test :settings do
9
- assert subject_class.log_level == :normal
10
- assert subject_class.log_color == :green
11
- end
3
+ test :subject_class do
4
+ assert subject_class == DevSystem::Generator
5
+ end
12
6
 
7
+ test :settings do
8
+ assert subject_class.log_level == :normal
9
+ assert subject_class.log_color == :green
13
10
  end
11
+
14
12
  end
@@ -1,80 +1,80 @@
1
- class DevSystem
2
- class AppGenerator < Generator
1
+ class DevSystem::AppGenerator < DevSystem::Generator
3
2
 
4
- def self.call args
5
- log :higher, "Called #{self}.#{__method__} with args #{args}"
6
- new.call args
7
- end
3
+ def self.call args
4
+ log :higher, "Called #{self}.#{__method__} with args #{args}"
5
+ new.call args
6
+ end
8
7
 
9
- def call args
10
- # setup
8
+ def call args
9
+ # setup
11
10
 
12
- name = args.shift || "app_1"
11
+ name = args.shift || "app_1"
13
12
 
14
- from = "#{Lizarb::APP_DIR}/app_new"
15
- to = name
13
+ from = "#{Lizarb::APP_DIR}/app_new"
14
+ to = name
16
15
 
17
- return log "Directory #{to.light_green} already exists." if Dir.exist? to
16
+ return log "Directory #{to.light_green} already exists." if Dir.exist? to
18
17
 
19
- log "Liza Application initializing at `#{to}`"
18
+ log "Liza Application initializing at `#{to}`"
20
19
 
21
- # init
20
+ # init
22
21
 
23
- require "fileutils"
24
- FileUtils.cp_r from, to, verbose: true
22
+ DirShell.create to
23
+ TextShell.write "#{to}/.gitignore", render("hidden.gitignore")
24
+ TextShell.write "#{to}/Gemfile", render("Gemfile.rb")
25
+ TextShell.write "#{to}/Procfile", render("Procfile.yml")
25
26
 
26
- `cd #{to}; git init -b main`
27
+ `cd #{to}; git init -b main`
27
28
 
28
- # extra
29
+ # extra
29
30
 
30
- puts
31
+ puts
31
32
 
32
- FileShell.gitkeep "#{to}/lib"
33
- FileShell.gitkeep "#{to}/tmp"
33
+ FileShell.gitkeep "#{to}/lib"
34
+ FileShell.gitkeep "#{to}/tmp"
34
35
 
35
- DirShell.create "#{to}/app"
36
+ DirShell.create "#{to}/app"
36
37
 
37
- # systems
38
+ # systems
38
39
 
39
- # App.systems.keys.each { |system_name| copy to, system_name }
40
- copy to, :dev
40
+ # App.systems.keys.each { |system_name| copy to, system_name }
41
+ copy to, :dev
41
42
 
42
- FileUtils.rm "#{to}/app/dev/commands/new_command.rb"
43
- FileUtils.rm "#{to}/app/dev/commands/new_command_test.rb"
43
+ FileUtils.rm "#{to}/app/dev/commands/new_command.rb"
44
+ FileUtils.rm "#{to}/app/dev/commands/new_command_test.rb"
44
45
 
45
- `rm -rf #{to}/app/dev/generators/record_generator*`
46
- `rm -rf #{to}/app/dev/generators/request_generator*`
46
+ `rm -rf #{to}/app/dev/generators/record_generator*`
47
+ `rm -rf #{to}/app/dev/generators/request_generator*`
47
48
 
48
- FileUtils.cp_r "#{Lizarb::APP_DIR}/.ruby-version", "#{to}/.ruby-version", verbose: true
49
- FileUtils.cp_r "#{Lizarb::APP_DIR}/README.md", "#{to}/README.md", verbose: true
50
- TextShell.write "#{to}/app.rb", render("app.rb")
51
- FileUtils.cp_r "#{Lizarb::APP_DIR}/app.env", "#{to}/app.env", verbose: true
52
- FileUtils.cp_r "#{Lizarb::APP_DIR}/app.code.env", "#{to}/app.code.env", verbose: true
49
+ FileUtils.cp_r "#{Lizarb::APP_DIR}/.ruby-version", "#{to}/.ruby-version", verbose: true
50
+ FileUtils.cp_r "#{Lizarb::APP_DIR}/README.md", "#{to}/README.md", verbose: true
51
+ TextShell.write "#{to}/app.rb", render("app.rb")
52
+ FileUtils.cp_r "#{Lizarb::APP_DIR}/app.env", "#{to}/app.env", verbose: true
53
+ FileUtils.cp_r "#{Lizarb::APP_DIR}/app.code.env", "#{to}/app.code.env", verbose: true
53
54
 
54
- puts
55
+ puts
55
56
 
56
- log "Liza Application initialized at `#{to}`"
57
- end
57
+ log "Liza Application initialized at `#{to}`"
58
+ end
58
59
 
59
- def copy name, system_name
60
- from = "#{Lizarb::APP_DIR}/app/#{system_name}_box.rb"
61
- to = "#{name}/app"
62
- if File.exist? from
63
- FileUtils.cp_r from, to, verbose: true
64
- else
65
- puts "file not found #{from}"
66
- end
67
-
68
- from = "#{Lizarb::APP_DIR}/app/#{system_name}"
69
- to = "#{name}/app"
70
- if File.exist? from
71
- FileUtils.cp_r from, to, verbose: true
72
- else
73
- puts "file not found #{from}"
74
- end
60
+ def copy name, system_name
61
+ from = "#{Lizarb::APP_DIR}/app/#{system_name}_box.rb"
62
+ to = "#{name}/app"
63
+ if File.exist? from
64
+ FileUtils.cp_r from, to, verbose: true
65
+ else
66
+ puts "file not found #{from}"
75
67
  end
76
68
 
69
+ from = "#{Lizarb::APP_DIR}/app/#{system_name}"
70
+ to = "#{name}/app"
71
+ if File.exist? from
72
+ FileUtils.cp_r from, to, verbose: true
73
+ else
74
+ puts "file not found #{from}"
75
+ end
77
76
  end
77
+
78
78
  end
79
79
 
80
80
  __END__
@@ -94,3 +94,53 @@ App.call ARGV do
94
94
  mode :demo
95
95
 
96
96
  end
97
+
98
+ # hidden.gitignore.erb
99
+
100
+ # Ignore all files in all subdirectories
101
+ .gitignore/.bundle/
102
+ /tmp/
103
+ *.sqlite
104
+ *.rdb
105
+
106
+ # Procfile.yml.erb
107
+
108
+ <%= "# HEROKU EXAMPLE" %>
109
+
110
+ web: LIZA_MODE=demo bundle exec liza rack h=0.0.0.0 p=$PORT
111
+
112
+ # Gemfile.rb.erb
113
+
114
+ <%= "# frozen_string_literal: true" %>
115
+
116
+ source "https://rubygems.org"
117
+
118
+ ruby File.read(".ruby-version").strip
119
+
120
+ group :default do
121
+ gem "lizarb", "~> <%= Lizarb::VERSION %>"
122
+ # gem "lizarb", github: "rubyonrails-brasil/lizarb"
123
+ end
124
+
125
+ group :dev do
126
+ # gems you only want to load if DevSystem is loaded
127
+ # gem "pry", "~> 0.14.1"
128
+ end
129
+
130
+ group :happy do
131
+ # gems you only want to load if HappySystem is loaded
132
+ end
133
+
134
+ group :net do
135
+ # gems you only want to load if NetSystem is loaded
136
+ # gem "redis", "~> 5.0"
137
+ # gem "sqlite3", "~> 1.5"
138
+ end
139
+
140
+ group :web do
141
+ # gems you only want to load if WebSystem is loaded
142
+ # gem "rack", "~> 3.0"
143
+ # gem "rackup", "~> 0.2.2"
144
+ # gem "puma", "~> 5.6"
145
+ # gem "htmlbeautifier", "~> 1.4"
146
+ end
@@ -1,14 +1,12 @@
1
- class DevSystem
2
- class AppGeneratorTest < GeneratorTest
1
+ class DevSystem::AppGeneratorTest < DevSystem::GeneratorTest
3
2
 
4
- test :subject_class do
5
- assert subject_class == DevSystem::AppGenerator
6
- end
7
-
8
- test :settings do
9
- assert subject_class.log_level == :normal
10
- assert subject_class.log_color == :green
11
- end
3
+ test :subject_class do
4
+ assert subject_class == DevSystem::AppGenerator
5
+ end
12
6
 
7
+ test :settings do
8
+ assert subject_class.log_level == :normal
9
+ assert subject_class.log_color == :green
13
10
  end
11
+
14
12
  end