startup for config

This commit is contained in:
Matthew K. Fu JuYuan committed 2012-09-13 18:31:44 +08:00
1 parent 01a8a9b5b6
commit f009a1c942
8 files changed
+155

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
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
+16
View File
@@ -0,0 +1,16 @@
module OrbitApp
module DSL
def backend_side_bar(name,&block)
BackendSideBar.new(name,&block)
end
def plugin_summary(name,&block)
# Plugin::PluginSummary.new(name,&block)
end
def module_summary(name,&block)
Module::ModuleSummary.new(name,&block)
end
end
end
+20
View File
@@ -0,0 +1,20 @@
#encoding: utf-8
require "orbit_app/summary"
module OrbitApp
module Module
module ModuleSummary
include Summary
class Item
def initialize()
@top = {:label => "全部內容有",:value=> "2071"}
@items = [{:label => "新聞",:value=> "20"}]
end
end
end
end
end
+10
View File
@@ -0,0 +1,10 @@
require "orbit_app/summary"
module OrbitApp
module Plugin
module PluginSummary
include OrbitApp::Summary
end
end
end
+46
View File
@@ -0,0 +1,46 @@
module OrbitApp
module Summary
Version = "0.1"
module ClassMethods
@@summaries = []
def new( name ,&block)
@@summaries << Item.new(name,&block)
binding.pry
end
def all
return @@summaries
end
end
extend ClassMethods
def self.included( other )
other.extend( ClassMethods )
end
# def initialize( k )
# @@summaries += 1
# binding.pry
# end
class Item
@name =""
def initialize(name = "test",&block)
@name = name
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
end
def get_name
return @name
end
end
end
end