classes view separated out
This commit is contained in:
parent
ab08fcc7c1
commit
bdfafd17c8
16
app/main/controllers/classes_controller.rb
Normal file
16
app/main/controllers/classes_controller.rb
Normal file
@ -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
|
@ -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
|
||||
|
12
app/main/views/classes/index.html
Normal file
12
app/main/views/classes/index.html
Normal file
@ -0,0 +1,12 @@
|
||||
<:Title>
|
||||
classes index
|
||||
|
||||
<:Body>
|
||||
<div class="classes">
|
||||
<h4> Classes </h4>
|
||||
{{page._classes.each do |clas| }}
|
||||
<div class="one-class">
|
||||
{{ clas._name }}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
@ -2,14 +2,7 @@
|
||||
Home
|
||||
|
||||
<:Body>
|
||||
<div class="classes">
|
||||
<h4> Classes </h4>
|
||||
{{page._classes.each do |clas| }}
|
||||
<div class="one-class">
|
||||
{{ clas._name }}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<:classes />
|
||||
|
||||
<div class="file-view">
|
||||
</div>
|
||||
|
5
spec/app/main/integration/classes_spec.rb
Normal file
5
spec/app/main/integration/classes_spec.rb
Normal file
@ -0,0 +1,5 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe '', type: :feature do
|
||||
# Specs here
|
||||
end
|
Loading…
Reference in New Issue
Block a user