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

#htmlize

Methods included from Web::Configuration

#selected?, #short

Constructor Details

#initialize(baseurl = nil, project_id = nil) ⇒ JIRA

Returns a new instance of JIRA.



75
76
77
# File 'lib/damagecontrol/tracker.rb', line 75

def initialize(baseurl=nil, project_id=nil)
  @baseurl, @project_id = baseurl, project_id
end

Instance Attribute Details

#baseurlObject

Returns the value of attribute baseurl.



72
73
74
# File 'lib/damagecontrol/tracker.rb', line 72

def baseurl
  @baseurl
end

#project_idObject

Returns the value of attribute project_id.



73
74
75
# File 'lib/damagecontrol/tracker.rb', line 73

def project_id
  @project_id
end

Instance Method Details

#highlight(s) ⇒ Object



87
88
89
90
91
92
93
94
# File 'lib/damagecontrol/tracker.rb', line 87

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



79
80
81
# File 'lib/damagecontrol/tracker.rb', line 79

def name
  "JIRA"
end

#urlObject



83
84
85
# File 'lib/damagecontrol/tracker.rb', line 83

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