class Smeagol::Views::Versions

Public Class Methods

new(master) click to toggle source

Initializes a new mustache view template data object.

master - Master controller, which creates all the views.

Returns a new page object.

# File lib/smeagol/views/versions.rb, line 9
def initialize(master)
  @master  = master
  @wiki    = master.wiki

  setup_template_path
end

Public Instance Methods

content() click to toggle source

Public: The HTML formatted content of the page.

# File lib/smeagol/views/versions.rb, line 17
def content
  html = "<a href=\"/\">Current</a><br/>"
  wiki.repo.tags.each do |tag|
    href = tag.name.start_with?('v') ? "/#{tag.name}" : "/v#{tag.name}"
    html << "<a href=\"#{href}\">#{tag.name}</a><br/>"
  end
  html
end
layout() click to toggle source

TODO: Allow customization ?

# File lib/smeagol/views/versions.rb, line 33
def layout
  IO.read(LIBDIR + "/templates/layouts/versions.mustache")
end
source_url() click to toggle source

Public: The URL of the project source code. This is set in the settings file.

# File lib/smeagol/views/versions.rb, line 28
def source_url
  settings.source_url
end