Class: DamageControl::SCMWeb::ViewCVS

Inherits:
Object
  • Object
show all
Defined in:
lib/damagecontrol/scm_web.rb

Direct Known Subclasses

Fisheye

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(baseurl) ⇒ ViewCVS

Returns a new instance of ViewCVS.



19
20
21
# File 'lib/damagecontrol/scm_web.rb', line 19

def initialize(baseurl)
  @baseurl = baseurl
end

Instance Attribute Details

#baseurlObject

Returns the value of attribute baseurl.



17
18
19
# File 'lib/damagecontrol/scm_web.rb', line 17

def baseurl
  @baseurl
end

Instance Method Details

#change_url(change, anchor = false) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/damagecontrol/scm_web.rb', line 27

def change_url(change, anchor=false)
  result = nil
  if(change.previous_revision)
    result = "#{url}#{change.path}?r1=#{change.previous_revision}&r2=#{change.revision}"
  else
    # point to the viewcvs (rev) and fisheye (r) revisions (no diff view)
    result = "#{url}#{change.path}?rev=#{change.revision}&r=#{change.revision}"
  end
  anchor ? "<a href=\"#{result}\">#{change.path}</a>" : result
end

#changeset_url(changeset, anchor = false) ⇒ Object



38
39
40
# File 'lib/damagecontrol/scm_web.rb', line 38

def changeset_url(changeset, anchor=false)
  url
end

#urlObject



23
24
25
# File 'lib/damagecontrol/scm_web.rb', line 23

def url
  RSCM::PathConverter.ensure_trailing_slash(baseurl)
end