templates/default/layout/html/setup.rb in yard-0.4.0 vs templates/default/layout/html/setup.rb in yard-0.5.0
- old
+ new
@@ -2,30 +2,30 @@
@breadcrumb = []
if @file
@contents = IO.read(@file)
@file = File.basename(@file)
- @fname = @file.gsub(/\..+$/, '')
+ @fname = @file.gsub(/\.[^.]+$/, '')
@breadcrumb_title = "File: " + @fname
@page_title ||= @breadcrumb_title
sections :layout, [:diskfile]
elsif object
case object
when '_index.html'
@page_title = options[:title]
sections :layout, [:index]
when CodeObjects::Base
- if object != Registry.root
+ unless object.root?
cur = object.namespace
- while cur != Registry.root
+ while !cur.root?
@breadcrumb.unshift(cur)
cur = cur.namespace
end
end
@page_title = format_object_title(object)
- type = object == Registry.root ? :module : object.type
+ type = object.root? ? :module : object.type
sections :layout, [T(type)]
end
else
sections :layout, [:contents]
end
@@ -35,10 +35,10 @@
@contents
end
def index
@objects_by_letter = {}
- objects = @objects.reject {|o| o == Registry.root }.sort_by {|o| o.name.to_s }
+ objects = @objects.reject {|o| o.root? }.sort_by {|o| o.name.to_s }
objects.each {|o| (@objects_by_letter[o.name.to_s[0,1].upcase] ||= []) << o }
erb(:index)
end
def diskfile
\ No newline at end of file