Class: DamageControl::Tracker::Trac

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(url = "http://trac.org/") ⇒ Trac

Returns a new instance of Trac.



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

def initialize(url="http://trac.org/")
  @url = url
end

Instance Attribute Details

#urlObject

Returns the value of attribute url.



69
70
71
# File 'lib/damagecontrol/tracker.rb', line 69

def url
  @url
end

Instance Method Details

#highlight(s) ⇒ Object



79
80
81
82
83
84
85
86
# File 'lib/damagecontrol/tracker.rb', line 79

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

#nameObject



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

def name
  "Trac"
end