Class: DamageControl::Tracker::JIRA

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

classes, #htmlize, register

Methods included from Web::Configuration

#selected?, #short

Constructor Details

#initialize(baseurl = "http://jira.codehaus.org/", project_id = "") ⇒ JIRA

Returns a new instance of JIRA.



101
102
103
# File 'lib/damagecontrol/tracker.rb', line 101

def initialize(baseurl="http://jira.codehaus.org/", project_id="")
  @baseurl, @project_id = baseurl, project_id
end

Instance Attribute Details

#baseurlObject

Returns the value of attribute baseurl.



96
97
98
# File 'lib/damagecontrol/tracker.rb', line 96

def baseurl
  @baseurl
end

#project_idObject

Returns the value of attribute project_id.



99
100
101
# File 'lib/damagecontrol/tracker.rb', line 99

def project_id
  @project_id
end

Instance Method Details

#highlight(s) ⇒ Object



113
114
115
116
117
118
119
120
# File 'lib/damagecontrol/tracker.rb', line 113

def highlight(s)
  url = RSCM::PathConverter.ensure_trailing_slash(baseurl)
  if(url)
    htmlize(s.gsub(/([A-Z]+-[0-9]+)/, "<a href=\"#{url}browse/\\1\">\\1</a>"))
  else
    htmlize(s)
  end
end

#nameObject



105
106
107
# File 'lib/damagecontrol/tracker.rb', line 105

def name
  "JIRA"
end

#urlObject



109
110
111
# File 'lib/damagecontrol/tracker.rb', line 109

def url
  "#{RSCM::PathConverter.ensure_trailing_slash(baseurl)}browse/#{project_id}"
end