Class: Rock::HTML::AutoprojPackage

Inherits:
Object
  • Object
show all
Defined in:
lib/rock/html/autoproj_package.rb

Overview

Rendering object that displays information about autoproj packages

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ AutoprojPackage

Returns a new instance of AutoprojPackage



7
8
9
10
# File 'lib/rock/html/autoproj_package.rb', line 7

def initialize(page)
    @page = page
    @template = page.load_template(TEMPLATE_DIR, 'autoproj_package.page')
end

Instance Attribute Details

#pageObject (readonly)

Returns the value of attribute page



5
6
7
# File 'lib/rock/html/autoproj_package.rb', line 5

def page
  @page
end

#templateObject (readonly)

Returns the value of attribute template



5
6
7
# File 'lib/rock/html/autoproj_package.rb', line 5

def template
  @template
end

Instance Method Details

#api_url(pkg) ⇒ Object



16
17
18
19
20
# File 'lib/rock/html/autoproj_package.rb', line 16

def api_url(pkg)
    if page.respond_to?(:api_url) && (url = page.api_url(pkg))
        url
    end
end

#render(info, object) ⇒ Object



12
13
14
# File 'lib/rock/html/autoproj_package.rb', line 12

def render(info, object)
    page.push nil, template.result(binding)
end

#render_vcs(vcs) ⇒ Object



22
23
24
# File 'lib/rock/html/autoproj_package.rb', line 22

def render_vcs(vcs)
    MetaRuby::GUI::HTML::Page.to_html_body(vcs, AutoprojVCS)
end