Class: Smeagol::Views::Versions
- Defined in:
- lib/smeagol/views/versions.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#content ⇒ Object
The HTML formatted content of the page.
-
#initialize(master) ⇒ Object
constructor
Initializes a new mustache view template data object.
-
#layout ⇒ Object
TODO: Allow customization ?.
-
#source_url ⇒ Object
The URL of the project source code.
Methods inherited from Base
#base_path, #custom_layout, #custom_layout?, #default_layout, #filename, #mathjax, #menu_html, #metadata, #name, #post?, #posts, #ribbon_html, #ribbon_url, #settings, #setup_template_path, #standard_layout, #tagline, #tracking_id, #wiki_title
Constructor Details
#initialize(master) ⇒ Object
Initializes a new mustache view template data object.
9 10 11 12 13 14 |
# File 'lib/smeagol/views/versions.rb', line 9 def initialize(master) @master = master @wiki = master.wiki setup_template_path end |
Instance Method Details
#content ⇒ Object
The HTML formatted content of the page.
17 18 19 20 21 22 23 24 |
# File 'lib/smeagol/views/versions.rb', line 17 def content html = "<a href=\"/\">Current</a><br/>" wiki.repo..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 ⇒ Object
TODO: Allow customization ?
33 34 35 |
# File 'lib/smeagol/views/versions.rb', line 33 def layout IO.read(LIBDIR + "/templates/layouts/versions.mustache") end |
#source_url ⇒ Object
The URL of the project source code. This is set in the settings file.
28 29 30 |
# File 'lib/smeagol/views/versions.rb', line 28 def source_url settings.source_url end |