diff --git a/app/main/controllers/classes_controller.rb b/app/main/controllers/classes_controller.rb new file mode 100644 index 0000000..f4c530c --- /dev/null +++ b/app/main/controllers/classes_controller.rb @@ -0,0 +1,16 @@ +module Main + class ClassesController < Volt::ModelController + + def initialize *args + super(*args) + + page._classes!.clear + Virtual.machine.space.classes.each do |name , claz| + next if [:Kernel,:Module,:MetaClass,:BinaryCode].index name + c = Volt::Model.new :name => name + page._classes << c + end + end + + end +end diff --git a/app/main/controllers/main_controller.rb b/app/main/controllers/main_controller.rb index 8b4d5a6..3bd9fd8 100644 --- a/app/main/controllers/main_controller.rb +++ b/app/main/controllers/main_controller.rb @@ -14,7 +14,6 @@ module Main def index init_machine - init_classes init_blocks init_source end @@ -34,14 +33,6 @@ module Main @volt_app.interpreter.start machine.init end - def init_classes - page._classes!.clear - Virtual.machine.space.classes.each do |name , claz| - next if [:Kernel,:Module,:MetaClass,:BinaryCode].index name - c = Volt::Model.new :name => name - page._classes << c - end - end def init_blocks blocks = BlocksModel.new page._blocks = blocks diff --git a/app/main/views/classes/index.html b/app/main/views/classes/index.html new file mode 100644 index 0000000..309bb69 --- /dev/null +++ b/app/main/views/classes/index.html @@ -0,0 +1,12 @@ +<:Title> + classes index + +<:Body> +
+

Classes

+ {{page._classes.each do |clas| }} +
+ {{ clas._name }} +
+ {{end}} +
diff --git a/app/main/views/main/index.html b/app/main/views/main/index.html index 8938bc2..6be23f2 100644 --- a/app/main/views/main/index.html +++ b/app/main/views/main/index.html @@ -2,14 +2,7 @@ Home <:Body> -
-

Classes

- {{page._classes.each do |clas| }} -
- {{ clas._name }} -
- {{end}} -
+ <:classes />
diff --git a/spec/app/main/integration/classes_spec.rb b/spec/app/main/integration/classes_spec.rb new file mode 100644 index 0000000..f8c4990 --- /dev/null +++ b/spec/app/main/integration/classes_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe '', type: :feature do + # Specs here +end