first version app config for Spen durning Chris's leave.
This commit is contained in:
1 parent
2321116597
commit
3a65f599e6
16 files changed
+191
-55
No files matched your search
@@ -1,15 +0,0 @@
|
||||
module OrbitApp
|
||||
class BackendSideBar
|
||||
attr_reader :name
|
||||
|
||||
def initialize(name, &block)
|
||||
@name = name
|
||||
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
|
||||
end
|
||||
|
||||
def item(*args)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
+18
-8
@@ -1,16 +1,26 @@
|
||||
module OrbitApp
|
||||
module DSL
|
||||
def backend_side_bar(name,&block)
|
||||
BackendSideBar.new(name,&block)
|
||||
def registration(name,type ={:type=> "ModuleApp"} ,&block)
|
||||
if type[:type] == "ModuleApp"
|
||||
Module::Registration.new(name,&block)
|
||||
elsif type[:type] == "PersonalPlugin"
|
||||
Plugin::Registration.new(name,&block)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def plugin_summary(name,&block)
|
||||
# Plugin::PluginSummary.new(name,&block)
|
||||
end
|
||||
|
||||
def module_summary(name,&block)
|
||||
Module::ModuleSummary.new(name,&block)
|
||||
end
|
||||
# def backend_side_bar(name,&block)
|
||||
# Module::BackendSideBar.new(name,&block)
|
||||
# end
|
||||
|
||||
# def plugin_summary(name,&block)
|
||||
# # Plugin::PluginSummary.new(name,&block)
|
||||
# end
|
||||
|
||||
# def module_summary(name,&block)
|
||||
# Module::Summary.new(name,&block)
|
||||
# end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,17 @@
|
||||
module OrbitApp
|
||||
module Module
|
||||
class BackendSideBar
|
||||
attr_reader :name
|
||||
|
||||
def initialize(name, &block)
|
||||
@name = name
|
||||
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
|
||||
end
|
||||
|
||||
# def personal_plugin(*args)
|
||||
# binding.pry
|
||||
# end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,54 @@
|
||||
module OrbitApp
|
||||
module Module
|
||||
module Registration
|
||||
Version = "0.1"
|
||||
|
||||
module ClassMethods
|
||||
@@registrations = []
|
||||
|
||||
def new( name ,&block)
|
||||
@@registrations << DataSheet.new(name,&block)
|
||||
end
|
||||
|
||||
def find_by_key(key)
|
||||
@@registrations.each{|t|
|
||||
return t if t.name == key
|
||||
}
|
||||
return nil
|
||||
end
|
||||
|
||||
def all
|
||||
return @@registrations
|
||||
end
|
||||
end
|
||||
|
||||
extend ClassMethods
|
||||
def self.included( other )
|
||||
other.extend( ClassMethods )
|
||||
end
|
||||
|
||||
class DataSheet
|
||||
attr_reader :name
|
||||
attr_reader :base_path
|
||||
|
||||
def initialize(name, &block)
|
||||
@name = name
|
||||
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
|
||||
end
|
||||
|
||||
def plugin
|
||||
|
||||
end
|
||||
|
||||
def personal_plugin(params)
|
||||
# TODO 這裡要看是一些檔案是不是都有
|
||||
Plugin::Registration.new_from_module_app(@name,@base_path,params)
|
||||
end
|
||||
|
||||
def base_url(var)
|
||||
@base_path = var
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -3,8 +3,8 @@ require "orbit_app/summary"
|
||||
|
||||
module OrbitApp
|
||||
module Module
|
||||
module ModuleSummary
|
||||
include Summary
|
||||
module Summary
|
||||
include OrbitApp::Summary
|
||||
|
||||
class Item
|
||||
def initialize()
|
||||
@@ -0,0 +1,58 @@
|
||||
module OrbitApp
|
||||
module Plugin
|
||||
module Registration
|
||||
Version = "0.1"
|
||||
|
||||
module ClassMethods
|
||||
@@registrations = []
|
||||
|
||||
def new( name ,&block)
|
||||
@@registrations << DataSheet.new(name,&block)
|
||||
end
|
||||
|
||||
def new_from_module_app(name,base_path,arg)
|
||||
@@registrations << DataSheet.new(name,arg,:base_path=>base_path)
|
||||
end
|
||||
|
||||
def find_by_key(key)
|
||||
@@registrations.each{|t|
|
||||
return t if t.name == key
|
||||
}
|
||||
return nil
|
||||
end
|
||||
|
||||
def all
|
||||
return @@registrations
|
||||
end
|
||||
end
|
||||
|
||||
extend ClassMethods
|
||||
def self.included( other )
|
||||
other.extend( ClassMethods )
|
||||
end
|
||||
|
||||
class DataSheet
|
||||
attr_reader :name
|
||||
attr_reader :base_path
|
||||
|
||||
|
||||
def initialize(name,partial=nil,*args ,&block)
|
||||
@base_path = args[0][:base_path]
|
||||
@name = name
|
||||
@partial_path = ''
|
||||
|
||||
unless partial.nil?
|
||||
@partial_path = partial[:path]
|
||||
end
|
||||
|
||||
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
|
||||
end
|
||||
|
||||
def profile_partial_path
|
||||
return @partial_path
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2,7 +2,8 @@ require "orbit_app/summary"
|
||||
|
||||
module OrbitApp
|
||||
module Plugin
|
||||
module PluginSummary
|
||||
module Summary
|
||||
# include OrbitApp::Summary
|
||||
include OrbitApp::Summary
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user