lizarb 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +12 -13
  3. data/Rakefile +38 -0
  4. data/app/dev_box.rb +26 -4
  5. data/app/happy_box.rb +2 -2
  6. data/app/net/databases/sqlite_db_test.rb +5 -5
  7. data/app/net/records/app_record_test.rb +1 -1
  8. data/app/net/records/post_record_test.rb +1 -1
  9. data/app/net/records/user_record_test.rb +1 -1
  10. data/app/net_box.rb +9 -9
  11. data/app/web_box.rb +4 -4
  12. data/app.rb +6 -7
  13. data/{exe/Gemfile → app_global.gemfile.rb} +2 -0
  14. data/app_global.gemfile.rb.lock +19 -0
  15. data/app_global.rb +4 -0
  16. data/{app → app_new}/dev/benches/loops_bench.rb +3 -2
  17. data/{app/dev/generators/bench_generator_test.rb → app_new/dev/benches/loops_bench_test.rb} +2 -2
  18. data/app_new/dev/benches/objects_bench.rb +83 -0
  19. data/{app/dev/generators/record_generator_test.rb → app_new/dev/benches/objects_bench_test.rb} +2 -2
  20. data/app_new/dev/benches/sorted_bench.rb +54 -0
  21. data/app_new/dev/benches/sorted_bench_test.rb +12 -0
  22. data/app_new/dev/benches/variables_bench.rb +55 -0
  23. data/{app/dev/generators/command_generator_test.rb → app_new/dev/benches/variables_bench_test.rb} +2 -2
  24. data/{app → app_new}/dev/commands/calculator_command.rb +1 -1
  25. data/{app → app_new}/dev/commands/circle_command.rb +1 -1
  26. data/{app → app_new}/dev/commands/narrative_method_command.rb +5 -7
  27. data/{app → app_new}/dev/commands/quadratic_command.rb +1 -1
  28. data/app_new/dev_box.rb +14 -0
  29. data/app_new.rb +15 -0
  30. data/exe/lizarb +9 -1
  31. data/lib/app.rb +27 -95
  32. data/lib/dev_system/dev/controllers/bench/not_found_bench.rb +23 -18
  33. data/lib/dev_system/dev/controllers/bench/not_found_bench_test.rb +9 -11
  34. data/lib/dev_system/dev/controllers/bench.rb +1 -9
  35. data/lib/dev_system/dev/controllers/bench_test.rb +8 -10
  36. data/lib/dev_system/dev/controllers/command/bench_command.rb +19 -22
  37. data/lib/dev_system/dev/controllers/command/bench_command_test.rb +8 -10
  38. data/lib/dev_system/dev/controllers/command/generate_command.rb +5 -31
  39. data/lib/dev_system/dev/controllers/command/generate_command_test.rb +8 -10
  40. data/lib/dev_system/dev/controllers/command/new_command.rb +9 -0
  41. data/lib/dev_system/dev/controllers/command/new_command_test.rb +7 -0
  42. data/lib/dev_system/dev/controllers/command/not_found_command.rb +37 -18
  43. data/lib/dev_system/dev/controllers/command/not_found_command_test.rb +8 -10
  44. data/lib/dev_system/dev/controllers/command/terminal_command.rb +12 -14
  45. data/lib/dev_system/dev/controllers/command/terminal_command_test.rb +8 -10
  46. data/lib/dev_system/dev/controllers/command/test_command.rb +64 -53
  47. data/lib/dev_system/dev/controllers/command/test_command_test.rb +8 -10
  48. data/lib/dev_system/dev/controllers/command.rb +9 -15
  49. data/lib/dev_system/dev/controllers/command_test.rb +8 -10
  50. data/lib/dev_system/dev/controllers/generator.rb +5 -7
  51. data/lib/dev_system/dev/controllers/generator_dsl_main_part.rb +33 -37
  52. data/lib/dev_system/dev/controllers/generator_test.rb +8 -10
  53. data/{app/dev/generators/bench_generator/bench.rb.erb → lib/dev_system/dev/controllers/generators/bench_generator/controller.rb.erb} +1 -2
  54. data/{app/dev/generators/bench_generator/bench_test.rb.erb → lib/dev_system/dev/controllers/generators/bench_generator/controller_test.rb.erb} +2 -2
  55. data/lib/dev_system/dev/controllers/generators/bench_generator.rb +12 -0
  56. data/lib/dev_system/dev/controllers/generators/bench_generator_test.rb +12 -0
  57. data/lib/dev_system/dev/controllers/generators/command_generator/controller.rb.erb +41 -0
  58. data/{app/dev/generators/command_generator/command_test.rb.erb → lib/dev_system/dev/controllers/generators/command_generator/controller_test.rb.erb} +2 -2
  59. data/lib/dev_system/dev/controllers/generators/command_generator.rb +19 -0
  60. data/lib/dev_system/dev/controllers/generators/command_generator_test.rb +12 -0
  61. data/lib/dev_system/dev/controllers/generators/controller_generator.rb +97 -0
  62. data/lib/dev_system/dev/controllers/generators/controller_generator_test.rb +12 -0
  63. data/lib/dev_system/dev/controllers/generators/generator_generator/template.rb.erb +1 -1
  64. data/lib/dev_system/dev/controllers/generators/new_generator.rb +117 -0
  65. data/lib/dev_system/dev/controllers/generators/new_generator_test.rb +12 -0
  66. data/lib/dev_system/dev/controllers/generators/not_found_generator.rb +27 -17
  67. data/lib/dev_system/dev/controllers/generators/not_found_generator_test.rb +8 -10
  68. data/{app/dev → lib/dev_system/dev/controllers}/generators/record_generator.rb +1 -1
  69. data/lib/dev_system/dev/controllers/generators/record_generator_test.rb +12 -0
  70. data/{app/dev → lib/dev_system/dev/controllers}/generators/request_generator.rb +2 -2
  71. data/lib/dev_system/dev/controllers/generators/request_generator_test.rb +12 -0
  72. data/lib/dev_system/dev/controllers/log.rb +3 -0
  73. data/{app/dev/generators/request_generator_test.rb → lib/dev_system/dev/controllers/log_test.rb} +2 -2
  74. data/lib/dev_system/dev/controllers/shell.rb +22 -0
  75. data/lib/dev_system/dev/controllers/shell_test.rb +25 -0
  76. data/lib/dev_system/dev/controllers/terminal/irb_terminal.rb +15 -11
  77. data/lib/dev_system/dev/controllers/terminal/irb_terminal_test.rb +8 -10
  78. data/lib/dev_system/dev/controllers/terminal/pry_terminal.rb +6 -8
  79. data/lib/dev_system/dev/controllers/terminal/pry_terminal_test.rb +8 -10
  80. data/lib/dev_system/dev/controllers/terminal.rb +11 -13
  81. data/lib/dev_system/dev/controllers/terminal_test.rb +8 -10
  82. data/lib/dev_system/dev/dev_box.rb +27 -16
  83. data/lib/dev_system/dev/dev_box_test.rb +12 -14
  84. data/lib/dev_system/dev/panels/bench_panel.rb +3 -0
  85. data/lib/dev_system/dev/panels/bench_panel_test.rb +12 -0
  86. data/lib/dev_system/dev/panels/command_panel.rb +59 -18
  87. data/lib/dev_system/dev/panels/command_panel_test.rb +43 -20
  88. data/lib/dev_system/dev/panels/generator_panel.rb +73 -0
  89. data/lib/dev_system/dev/panels/generator_panel_test.rb +46 -0
  90. data/lib/dev_system/dev/panels/log_panel.rb +9 -6
  91. data/lib/dev_system/dev/panels/log_panel_test.rb +11 -13
  92. data/lib/dev_system/dev/panels/shell_panel.rb +3 -0
  93. data/lib/dev_system/dev/panels/shell_panel_test.rb +12 -0
  94. data/lib/dev_system/dev/panels/terminal_panel.rb +3 -0
  95. data/lib/dev_system/dev/panels/terminal_panel_test.rb +12 -0
  96. data/lib/happy_system/happy/controllers/axo.rb +4 -5
  97. data/lib/happy_system/happy/happy_box.rb +5 -9
  98. data/lib/happy_system/happy/happy_box_test.rb +11 -13
  99. data/lib/happy_system/happy/panels/axo_panel.rb +1 -3
  100. data/lib/lerb.rb +95 -49
  101. data/lib/liza/base/box.rb +76 -26
  102. data/lib/liza/base/box_test.rb +7 -9
  103. data/lib/liza/base/controller.rb +19 -21
  104. data/lib/liza/base/controller_test.rb +7 -9
  105. data/lib/liza/base/panel.rb +40 -27
  106. data/lib/liza/base/panel_test.rb +36 -12
  107. data/lib/liza/base_parts/controller_renderer_part.rb +1 -1
  108. data/lib/liza/meta/part.rb +12 -14
  109. data/lib/liza/meta/part_extension.rb +14 -16
  110. data/lib/liza/meta/part_test.rb +4 -6
  111. data/lib/liza/meta/system.rb +12 -14
  112. data/lib/liza/meta/system_test.rb +8 -10
  113. data/lib/liza/ruby_test.rb +4 -6
  114. data/lib/liza/ruby_tests/module_test.rb +3 -3
  115. data/lib/liza/test/test.rb +7 -10
  116. data/lib/liza/test/test_test.rb +160 -157
  117. data/lib/liza/test_parts/test_assertions_advanced_part.rb +102 -104
  118. data/lib/liza/test_parts/test_assertions_part.rb +81 -83
  119. data/lib/liza/test_parts/test_dsl_part.rb +47 -49
  120. data/lib/liza/test_parts/test_log_part.rb +88 -90
  121. data/lib/liza/test_parts/test_subject_part.rb +16 -18
  122. data/lib/liza/test_parts/test_tree_part.rb +73 -120
  123. data/lib/liza/unit.rb +105 -107
  124. data/lib/liza/unit_parts/unit_procedure_part_test.rb +9 -9
  125. data/lib/liza/unit_parts/unit_settings_part.rb +76 -0
  126. data/lib/liza/unit_parts/unit_settings_part_test.rb +3 -0
  127. data/lib/liza/unit_test.rb +80 -71
  128. data/lib/liza.rb +10 -1
  129. data/lib/lizarb/ruby/module.rb +1 -1
  130. data/lib/lizarb/version.rb +1 -1
  131. data/lib/lizarb.rb +247 -23
  132. data/lib/net_system/dev/net_command.rb +15 -17
  133. data/lib/net_system/net/controllers/client/redis_client.rb +19 -21
  134. data/lib/net_system/net/controllers/client/redis_client_test.rb +20 -22
  135. data/lib/net_system/net/controllers/client/sqlite_client.rb +19 -21
  136. data/lib/net_system/net/controllers/client/sqlite_client_test.rb +20 -22
  137. data/lib/net_system/net/controllers/client.rb +1 -3
  138. data/lib/net_system/net/controllers/client_test.rb +8 -10
  139. data/lib/net_system/net/controllers/database/redis_db.rb +6 -8
  140. data/lib/net_system/net/controllers/database/redis_db_test.rb +15 -17
  141. data/lib/net_system/net/controllers/database/sqlite_db.rb +6 -8
  142. data/lib/net_system/net/controllers/database/sqlite_db_test.rb +15 -17
  143. data/lib/net_system/net/controllers/database.rb +21 -23
  144. data/lib/net_system/net/controllers/database_test.rb +8 -10
  145. data/lib/net_system/net/controllers/record.rb +21 -23
  146. data/lib/net_system/net/controllers/record_test.rb +8 -10
  147. data/lib/net_system/net/net_box.rb +9 -16
  148. data/lib/net_system/net/net_box_test.rb +12 -14
  149. data/lib/net_system/net/panels/client_panel.rb +1 -3
  150. data/lib/net_system/net/panels/client_panel_test.rb +11 -13
  151. data/lib/net_system/net/panels/database_panel.rb +6 -8
  152. data/lib/net_system/net/panels/database_panel_test.rb +11 -13
  153. data/lib/web_system/dev/rack_command.rb +20 -18
  154. data/lib/web_system/dev/request_command.rb +8 -22
  155. data/lib/web_system/dev/web_command.rb +6 -8
  156. data/lib/web_system/web/controllers/rack.rb +4 -6
  157. data/lib/web_system/web/controllers/rack_test.rb +11 -13
  158. data/lib/web_system/web/controllers/request/client_error_request.rb +9 -11
  159. data/lib/web_system/web/controllers/request/not_found_request.rb +9 -11
  160. data/lib/web_system/web/controllers/request/server_error_request.rb +10 -12
  161. data/lib/web_system/web/controllers/request.rb +1 -3
  162. data/lib/web_system/web/controllers/request_test.rb +11 -13
  163. data/lib/web_system/web/panels/rack_panel.rb +37 -39
  164. data/lib/web_system/web/panels/rack_panel_test.rb +8 -10
  165. data/lib/web_system/web/panels/request_panel.rb +53 -57
  166. data/lib/web_system/web/panels/request_panel_test.rb +1 -1
  167. data/lib/web_system/web/web_box.rb +12 -18
  168. data/lib/web_system/web/web_box_test.rb +11 -13
  169. data/lizarb.gemspec +1 -1
  170. metadata +54 -44
  171. data/.ruby-version +0 -1
  172. data/app/dev/benches/app_bench.rb +0 -5
  173. data/app/dev/benches/app_bench_test.rb +0 -7
  174. data/app/dev/benches/loops_bench_test.rb +0 -11
  175. data/app/dev/commands/app_command.rb +0 -5
  176. data/app/dev/commands/app_command_test.rb +0 -7
  177. data/app/dev/commands/new_command.rb +0 -9
  178. data/app/dev/commands/new_command_test.rb +0 -7
  179. data/app/dev/generators/bench_generator.rb +0 -18
  180. data/app/dev/generators/command_generator/command.rb.erb +0 -26
  181. data/app/dev/generators/command_generator.rb +0 -18
  182. data/app_new/.gitignore +0 -4
  183. data/app_new/Gemfile +0 -31
  184. data/app_new/Procfile +0 -3
  185. data/exe/Gemfile.lock +0 -13
  186. data/lib/dev_system/dev/controllers/bench_dsl_main_part.rb +0 -60
  187. data/lib/dev_system/dev/controllers/command/echo_command.rb +0 -11
  188. data/lib/dev_system/dev/controllers/command/echo_command_test.rb +0 -14
  189. data/lib/dev_system/dev/controllers/command/version_command.rb +0 -9
  190. data/lib/dev_system/dev/controllers/command/version_command_test.rb +0 -14
  191. data/lib/dev_system/dev/controllers/generators/app_generator.rb +0 -96
  192. data/lib/dev_system/dev/controllers/generators/app_generator_test.rb +0 -14
  193. /data/{app → app_new}/dev/commands/calculator_command_test.rb +0 -0
  194. /data/{app → app_new}/dev/commands/circle_command_test.rb +0 -0
  195. /data/{app → app_new}/dev/commands/narrative_method_command_test.rb +0 -0
  196. /data/{app → app_new}/dev/commands/quadratic_command_test.rb +0 -0
data/lib/liza/base/box.rb CHANGED
@@ -1,40 +1,90 @@
1
- module Liza
2
- class Box < Unit
3
- inherited_explicitly_sets_system
1
+ class Liza::Box < Liza::Unit
2
+ inherited_explicitly_sets_system
4
3
 
5
- def self.has_panel symbol, panel_name = symbol
6
- system_klass = get :system
7
- panel_class = system_klass.const "#{symbol}_panel"
4
+ # def self.has_panel symbol, panel_name = symbol
5
+ # system_klass = get :system
6
+ # panel_class = system_klass.const "#{symbol}_panel"
8
7
 
9
- _has_panel_define panel_name, "get(:panels)[:#{panel_name}]"
8
+ # _has_panel_define panel_name, "get(:panels)[:#{panel_name}]"
10
9
 
11
- panel = panel_class.new panel_name
12
- add :panels, panel_name, panel
10
+ # panel = panel_class.new panel_name
11
+ # add :panels, panel_name, panel
13
12
 
14
- panel_class.on_connected self
15
- end
13
+ # panel_class.on_connected self
14
+ # end
16
15
 
17
- def self.has_controller symbol, panel_name = symbol
18
- system_klass = get :system
19
- controller_class = system_klass.const symbol
16
+ # def self.has_controller symbol, panel_name = symbol
17
+ # system_klass = get :system
18
+ # controller_class = system_klass.const symbol
20
19
 
21
- panel = public_send panel_name
20
+ # panel = public_send panel_name
22
21
 
23
- controller_class.on_connected self, panel
24
- end
22
+ # controller_class.on_connected self, panel
23
+ # end
24
+
25
+ # def self.method_missing symbol, *args, &block
26
+ # if panels.has_key? symbol
27
+ # panels[symbol]
28
+ # else
29
+ # super
30
+ # end
31
+ # end
32
+
33
+ # def self.respond_to_missing? symbol, include_private = false
34
+ # get(:panels).keys.include?(symbol) || super
35
+ # end
36
+
37
+ # def self._has_panel_define name, resource
38
+ # class_eval <<-CODE, __FILE__, __LINE__ + 1
25
39
 
26
- def self._has_panel_define name, resource
27
- class_eval <<-CODE, __FILE__, __LINE__ + 1
40
+ # def self.#{name} &block
41
+ # if block_given?
42
+ # #{resource}.instance_eval &block
43
+ # else
44
+ # #{resource}
45
+ # end
46
+ # end
28
47
 
29
- def self.#{name} &block
30
- if block_given?
31
- #{resource}.instance_eval &block
32
- else
33
- #{resource}
48
+ # CODE
49
+ # end
50
+
51
+ def self.panels
52
+ get :panels
34
53
  end
35
- end
36
54
 
37
- CODE
55
+ def self.[] symbol
56
+ panels[symbol].started
57
+ end
58
+
59
+ def self.has_panel symbol, panel_class = nil, &block
60
+ raise ArgumentError, "block required" unless block_given?
61
+
62
+ system_class = get :system
63
+ panel_class ||= system_class.const "#{symbol}_panel"
64
+
65
+ if Hash(get :panels).has_key? symbol
66
+ panel = panels[symbol]
67
+ else
68
+ panel_class.on_connected self
69
+ panel = panel_class.new symbol
70
+ add :panels, symbol, panel
38
71
  end
72
+
73
+ panel.push block
74
+ end
75
+
76
+ def self.has_controller symbol, panel_name = symbol
77
+ system_klass = get :system
78
+ controller_class = system_klass.const symbol
79
+
80
+ panel = self[panel_name]
81
+
82
+ controller_class.on_connected self, panel
39
83
  end
84
+
85
+ def self.configure name, &block
86
+ has_panel name, &block
87
+ has_controller name, name
88
+ end
89
+
40
90
  end
@@ -1,12 +1,10 @@
1
- module Liza
2
- class BoxTest < UnitTest
3
- test :subject_class do
4
- assert subject_class == Liza::Box
5
- end
1
+ class Liza::BoxTest < Liza::UnitTest
2
+ test :subject_class do
3
+ assert subject_class == Liza::Box
4
+ end
6
5
 
7
- test :settings do
8
- assert subject_class.log_level == :normal
9
- assert subject_class.log_color == :white
10
- end
6
+ test :settings do
7
+ assert subject_class.log_level == :normal
8
+ assert subject_class.log_color == :white
11
9
  end
12
10
  end
@@ -1,29 +1,27 @@
1
- module Liza
2
- class Controller < Unit
3
- part :controller_renderer
1
+ class Liza::Controller < Liza::Unit
2
+ part :controller_renderer
4
3
 
5
- inherited_explicitly_sets_system
4
+ inherited_explicitly_sets_system
6
5
 
7
- def self.on_connected box_klass, panel
8
- set :box, box_klass
9
- set :panel, panel
10
- end
11
-
12
- def self.box
13
- get :box
14
- end
6
+ def self.on_connected box_klass, panel
7
+ set :box, box_klass
8
+ set :panel, panel
9
+ end
15
10
 
16
- def self.panel
17
- get :panel
18
- end
11
+ def self.box
12
+ get :box
13
+ end
19
14
 
20
- def box
21
- self.class.box
22
- end
15
+ def self.panel
16
+ get :panel
17
+ end
23
18
 
24
- def panel
25
- self.class.panel
26
- end
19
+ def box
20
+ self.class.box
21
+ end
27
22
 
23
+ def panel
24
+ self.class.panel
28
25
  end
26
+
29
27
  end
@@ -1,12 +1,10 @@
1
- module Liza
2
- class ControllerTest < UnitTest
3
- test :subject_class do
4
- assert subject_class == Liza::Controller
5
- end
1
+ class Liza::ControllerTest < Liza::UnitTest
2
+ test :subject_class do
3
+ assert subject_class == Liza::Controller
4
+ end
6
5
 
7
- test :settings do
8
- assert subject_class.log_level == :normal
9
- assert subject_class.log_color == :white
10
- end
6
+ test :settings do
7
+ assert subject_class.log_level == :normal
8
+ assert subject_class.log_color == :white
11
9
  end
12
10
  end
@@ -1,39 +1,52 @@
1
- module Liza
2
- class Panel < Unit
3
- inherited_explicitly_sets_system
1
+ class Liza::Panel < Liza::Unit
2
+ inherited_explicitly_sets_system
4
3
 
5
- def self.on_connected box_klass
6
- set :box, box_klass
7
- end
4
+ def self.on_connected box_klass
5
+ set :box, box_klass
6
+ end
8
7
 
9
- def self.box
10
- get :box
11
- end
8
+ def self.box
9
+ get :box
10
+ end
12
11
 
13
- def box
14
- self.class.box
15
- end
12
+ def box
13
+ self.class.box
14
+ end
16
15
 
17
- def initialize name
18
- @name = name
19
- end
16
+ #
20
17
 
21
- def log log_level = :normal, string
22
- raise "invalid log_level `#{log_level}`" unless LOG_LEVELS.keys.include? log_level
23
- return unless log_level? log_level
18
+ def initialize key
19
+ @key = key
20
+ @blocks = []
21
+ @unstarted = true
22
+ @short = {}
23
+ end
24
24
 
25
- source = box.to_s
25
+ #
26
26
 
27
- x = source.size
28
- source = source.bold.colorize log_color
27
+ def short a, b = nil
28
+ if b
29
+ @short[a.to_s] = b.to_s
30
+ else
31
+ @short[a.to_s] || a.to_s
32
+ end
33
+ end
29
34
 
30
- y = source.size
31
- source = "#{source}.#{@name}".ljust(LOG_JUST+y-x)
35
+ #
32
36
 
33
- string = "#{source} #{string}"
34
-
35
- DevBox.logs.call string
36
- end
37
+ def push block
38
+ @unstarted = true
39
+ @blocks.push block
40
+ end
37
41
 
42
+ def started
43
+ return self unless defined? @unstarted
44
+ remove_instance_variable :@unstarted
45
+
46
+ @blocks.each { |bl| instance_eval(&bl) }
47
+ @blocks.clear
48
+
49
+ self
38
50
  end
51
+
39
52
  end
@@ -1,16 +1,40 @@
1
- module Liza
2
- class PanelTest < UnitTest
3
- test :subject_class do
4
- assert subject_class == Liza::Panel
5
- end
1
+ class Liza::PanelTest < Liza::UnitTest
2
+ test :subject_class do
3
+ assert subject_class == Liza::Panel
4
+ end
6
5
 
7
- def subject
8
- subject_class.new "name"
9
- end
6
+ def subject
7
+ @subject ||= subject_class.new "name"
8
+ end
10
9
 
11
- test :settings do
12
- assert subject_class.log_level == :normal
13
- assert subject_class.log_color == :white
14
- end
10
+ test :settings do
11
+ assert subject_class.log_level == :normal
12
+ assert subject_class.log_color == :white
15
13
  end
14
+
15
+ test :short do
16
+ assert_equality subject.short("m"), "m"
17
+ assert_equality subject.short("i"), "i"
18
+ assert_equality subject.short("n"), "n"
19
+ assert_equality subject.short("s"), "s"
20
+ assert_equality subject.short("w"), "w"
21
+ assert_equality subject.short("a"), "a"
22
+ assert_equality subject.short("n"), "n"
23
+
24
+ subject.short :m, :matz
25
+ subject.short :i, :is
26
+ subject.short :n, :nice
27
+ subject.short :s, :so
28
+ subject.short :w, :we
29
+ subject.short :a, :are
30
+
31
+ assert_equality subject.short("m"), "matz"
32
+ assert_equality subject.short("i"), "is"
33
+ assert_equality subject.short("n"), "nice"
34
+ assert_equality subject.short("s"), "so"
35
+ assert_equality subject.short("w"), "we"
36
+ assert_equality subject.short("a"), "are"
37
+ assert_equality subject.short("n"), "nice"
38
+ end
39
+
16
40
  end
@@ -93,7 +93,7 @@ Did you forget to add ERB keys?
93
93
  s = erb.result the_binding, receiver
94
94
  _log_render_out key, s.length, t.diff
95
95
  s = wrap_comment_tags s, erb if App.mode == :code && erb.tags?
96
- stack.push s.strip
96
+ stack.push s
97
97
  end
98
98
 
99
99
  stack.pop
@@ -1,19 +1,17 @@
1
- module Liza
2
- class Part < Unit
3
- def self.insertion &block
4
- if block_given?
5
- @insertion = block
6
- else
7
- @insertion
8
- end
1
+ class Liza::Part < Liza::Unit
2
+ def self.insertion &block
3
+ if block_given?
4
+ @insertion = block
5
+ else
6
+ @insertion
9
7
  end
8
+ end
10
9
 
11
- def self.extension &block
12
- if block_given?
13
- @extension = block
14
- else
15
- @extension
16
- end
10
+ def self.extension &block
11
+ if block_given?
12
+ @extension = block
13
+ else
14
+ @extension
17
15
  end
18
16
  end
19
17
  end
@@ -1,18 +1,16 @@
1
- module Liza
2
- class PartExtension
3
- def self.solder
4
- @solder ||=
5
- if first_namespace == "Liza"
6
- Liza.const_get last_namespace[0..-12]
7
- else
8
- Object.const_get name[0..-12]
9
- end
10
- end
11
-
12
- def initialize solder
13
- @solder = solder
14
- end
1
+ class Liza::PartExtension
2
+ def self.solder
3
+ @solder ||=
4
+ if first_namespace == "Liza"
5
+ Liza.const_get last_namespace[0..-12]
6
+ else
7
+ Object.const_get name[0..-12]
8
+ end
9
+ end
15
10
 
16
- attr_reader :solder
11
+ def initialize solder
12
+ @solder = solder
17
13
  end
18
- end
14
+
15
+ attr_reader :solder
16
+ end
@@ -1,8 +1,6 @@
1
- module Liza
2
- class PartTest < Test
3
- test :subject_class do
4
- assert subject_class == Liza::Part
5
- end
6
-
1
+ class Liza::PartTest < Liza::Test
2
+ test :subject_class do
3
+ assert subject_class == Liza::Part
7
4
  end
5
+
8
6
  end
@@ -1,20 +1,18 @@
1
- module Liza
2
- class System < Unit
1
+ class Liza::System < Liza::Unit
3
2
 
4
- def self.const name
5
- const_get name.to_s.camelize
6
- end
3
+ def self.const name
4
+ const_get name.to_s.camelize
5
+ end
7
6
 
8
- def self.insertion key, &block
9
- if block_given?
10
- registrar[:"insertion_#{key}"] = block
11
- else
12
- registrar[:"insertion_#{key}"]
13
- end
7
+ def self.insertion key, &block
8
+ if block_given?
9
+ registrar[:"insertion_#{key}"] = block
10
+ else
11
+ registrar[:"insertion_#{key}"]
14
12
  end
13
+ end
15
14
 
16
- def self.registrar
17
- @registrar ||= {}
18
- end
15
+ def self.registrar
16
+ @registrar ||= {}
19
17
  end
20
18
  end
@@ -1,13 +1,11 @@
1
- module Liza
2
- class SystemTest < UnitTest
3
- test :subject_class do
4
- assert subject_class == Liza::System
5
- end
6
-
7
- test :settings do
8
- assert subject_class.log_level == :normal
9
- assert subject_class.log_color == :white
10
- end
1
+ class Liza::SystemTest < Liza::UnitTest
2
+ test :subject_class do
3
+ assert subject_class == Liza::System
4
+ end
11
5
 
6
+ test :settings do
7
+ assert subject_class.log_level == :normal
8
+ assert subject_class.log_color == :white
12
9
  end
10
+
13
11
  end
@@ -1,9 +1,7 @@
1
- module Liza
2
- class RubyTest < Test
3
-
4
- def self.subject_class
5
- @subject_class ||= Object.const_get last_namespace[0..-5]
6
- end
1
+ class Liza::RubyTest < Liza::Test
7
2
 
3
+ def self.subject_class
4
+ @subject_class ||= Object.const_get last_namespace[0..-5]
8
5
  end
6
+
9
7
  end
@@ -7,15 +7,15 @@ class Liza::ModuleTest < Liza::RubyTest
7
7
  test :source_location do
8
8
  assert Object.source_location == []
9
9
 
10
- assert Liza::Command.source_location[1] == 2
11
- assert AppCommand.source_location[1] == 1
10
+ assert Liza::Command.source_location[1] == 1
11
+ assert TerminalCommand.source_location[1] == 1
12
12
  end
13
13
 
14
14
  test :source_location_radical do
15
15
  assert Object.source_location_radical == nil
16
16
 
17
17
  assert Liza::Command.source_location_radical.end_with? "/lib/dev_system/dev/controllers/command"
18
- assert AppCommand.source_location_radical.end_with? "/app/dev/commands/app_command"
18
+ assert TerminalCommand.source_location_radical.end_with? "/lib/dev_system/dev/controllers/command/terminal_command"
19
19
  end
20
20
 
21
21
  end
@@ -1,13 +1,10 @@
1
- module Liza
2
- class Test < Unit
1
+ class Liza::Test < Liza::Unit
3
2
 
4
- part :test_assertions
5
- part :test_assertions_advanced
6
- part :test_dsl
7
- part :test_log
8
- part :test_subject
9
- part :test_tree
3
+ part :test_assertions
4
+ part :test_assertions_advanced
5
+ part :test_dsl
6
+ part :test_log
7
+ part :test_subject
8
+ part :test_tree
10
9
 
11
- end
12
10
  end
13
-