Move blog tab accessor and class array to blog file from tab file
This commit is contained in:
parent
4577f788e5
commit
3165574730
2 changed files with 12 additions and 12 deletions
|
@ -12,10 +12,16 @@ module Refinery
|
||||||
autoload :Tab, 'refinery/blog/tabs'
|
autoload :Tab, 'refinery/blog/tabs'
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
attr_accessor :root
|
attr_writer :root
|
||||||
|
attr_writer :tabs
|
||||||
|
|
||||||
def root
|
def root
|
||||||
@root ||= Pathname.new(File.expand_path('../../', __FILE__))
|
@root ||= Pathname.new(File.expand_path('../../', __FILE__))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def tabs
|
||||||
|
@tabs ||= []
|
||||||
|
end
|
||||||
|
|
||||||
def version
|
def version
|
||||||
::Refinery::Blog::Version.to_s
|
::Refinery::Blog::Version.to_s
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
module Refinery
|
module Refinery
|
||||||
module Blog
|
module Blog
|
||||||
attr_accessor :tabs
|
|
||||||
|
|
||||||
def self.tabs
|
|
||||||
@tabs ||= []
|
|
||||||
end
|
|
||||||
|
|
||||||
class Tab
|
class Tab
|
||||||
attr_accessor :name, :partial
|
attr_accessor :name, :partial
|
||||||
|
|
||||||
|
@ -18,11 +12,11 @@ module Refinery
|
||||||
raise "A tab MUST have a partial!: #{tab.inspect}" if tab.partial.blank?
|
raise "A tab MUST have a partial!: #{tab.inspect}" if tab.partial.blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
::Refinery::Blog.tabs << self # add me to the collection of registered page tabs
|
::Refinery::Blog.tabs << self # add me to the collection of registered page tabs
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Add table
Add a link
Reference in a new issue