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.



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

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.



93
94
95
# File 'lib/damagecontrol/tracker.rb', line 93

def baseurl
  @baseurl
end

#project_idObject

Returns the value of attribute project_id.



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

def project_id
  @project_id
end

Instance Method Details

#highlight(s) ⇒ Object



110
111
112
113
114
115
116
117
# File 'lib/damagecontrol/tracker.rb', line 110

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



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

def name
  "JIRA"
end

#urlObject



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

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