Class: Rock::Doc::HTML::VCSRenderingContext

Inherits:
RenderingContext show all
Defined in:
lib/rock/doc.rb

Instance Attribute Summary collapse

Attributes inherited from RenderingContext

#default_template, #object

Instance Method Summary collapse

Methods inherited from RenderingContext

#help_tip, #link_to, #render_item, #render_object

Constructor Details

#initialize(object) ⇒ VCSRenderingContext

Returns a new instance of VCSRenderingContext



304
305
306
# File 'lib/rock/doc.rb', line 304

def initialize(object)
    super(object, 'autoproj_vcs_fragment.page')
end

Instance Attribute Details

#vcsObject (readonly)

Returns the value of attribute vcs



308
309
310
# File 'lib/rock/doc.rb', line 308

def vcs
  @vcs
end

Instance Method Details

#render(*template_path) ⇒ Object



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/rock/doc.rb', line 310

def render(*template_path)
    if object.raw
        first = true
        raw_info = object.raw.map do |pkg_set, vcs_info|
            @vcs = vcs_info
            fragment = super
            if !first
                fragment = "<span class=\"vcs_override\">overriden in #{pkg_set}</span>" + fragment
            end
            first = false
            fragment
        end
        raw_vcs = "<div class=\"vcs\">Rock short definition<span class=\"toggle\">show/hide</span><div class=\"vcs_info\">#{raw_info.join("\n")}</div></div>"
    end

    @vcs = object
    raw_vcs +
    "<div class=\"vcs\">Autoproj definition<span class=\"toggle\">show/hide</span><div class=\"vcs_info\">#{super}</div></div>"
end