Class: Rock::Doc::HTML::VCSRenderingContext
- Inherits:
-
RenderingContext
- Object
- RenderingContext
- Rock::Doc::HTML::VCSRenderingContext
- Defined in:
- lib/rock/doc.rb
Instance Attribute Summary collapse
-
#vcs ⇒ Object
readonly
Returns the value of attribute vcs.
Attributes inherited from RenderingContext
Instance Method Summary collapse
-
#initialize(object) ⇒ VCSRenderingContext
constructor
A new instance of VCSRenderingContext.
- #render(*template_path) ⇒ Object
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
#vcs ⇒ Object (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 |