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.



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

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

Instance Attribute Details

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

Instance Method Details

#highlight(s) ⇒ Object



82
83
84
85
86
87
88
89
# File 'lib/damagecontrol/tracker.rb', line 82

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



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

def name
  "Trac"
end