Sha256: 0cb61c1488d1803819cf85f098d1ce0508170816415428756c97756e30736b7b

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 KB

Contents

def init
  @breadcrumb = []

  if @onefile
    sections :layout
  elsif @file
    @contents = File.read(@file)
    @file = File.basename(@file)
    @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, [:listing, [:files, :objects]]]
    when CodeObjects::Base
      unless object.root?
        cur = object.namespace
        while !cur.root?
          @breadcrumb.unshift(cur)
          cur = cur.namespace
        end
      end
    
      @page_title = format_object_title(object)
      type = object.root? ? :module : object.type
      sections :layout, [T(type)]
    end
  else
    sections :layout, [:contents]
  end
end

def contents
  @contents
end

def index
  @objects_by_letter = {}
  objects = Registry.all(:class, :module).sort_by {|o| o.name.to_s }
  objects = run_verifier(objects)
  objects.each {|o| (@objects_by_letter[o.name.to_s[0,1].upcase] ||= []) << o }
  erb(:index)
end

def diskfile
  data = htmlify(markup_file_contents(@contents), markup_for_file(@contents, @file))
  "<div id='filecontents'>" + data + "</div>"
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yard-0.6.8 templates/default/layout/html/setup.rb
yard-0.6.7 templates/default/layout/html/setup.rb
yard-0.6.6 templates/default/layout/html/setup.rb
yard-0.6.5 templates/default/layout/html/setup.rb