Class: DamageControl::Tracker::Scarab

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://scarab.org/", module_key = "") ⇒ Scarab

Returns a new instance of Scarab.



186
187
188
# File 'lib/damagecontrol/tracker.rb', line 186

def initialize(baseurl="http://scarab.org/", module_key="")
  @baseurl, @module_key = baseurl, module_key
end

Instance Attribute Details

#baseurlObject

Returns the value of attribute baseurl.



181
182
183
# File 'lib/damagecontrol/tracker.rb', line 181

def baseurl
  @baseurl
end

#module_keyObject

Returns the value of attribute module_key.



184
185
186
# File 'lib/damagecontrol/tracker.rb', line 184

def module_key
  @module_key
end

Instance Method Details

#highlight(s) ⇒ Object



198
199
200
201
202
203
204
205
# File 'lib/damagecontrol/tracker.rb', line 198

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

#nameObject



190
191
192
# File 'lib/damagecontrol/tracker.rb', line 190

def name
  "Scarab"
end

#urlObject



194
195
196
# File 'lib/damagecontrol/tracker.rb', line 194

def url
  baseurl
end