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.



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

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.



178
179
180
# File 'lib/damagecontrol/tracker.rb', line 178

def baseurl
  @baseurl
end

#module_keyObject

Returns the value of attribute module_key.



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

def module_key
  @module_key
end

Instance Method Details

#highlight(s) ⇒ Object



195
196
197
198
199
200
201
202
# File 'lib/damagecontrol/tracker.rb', line 195

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



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

def name
  "Scarab"
end

#urlObject



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

def url
  baseurl
end