Class: DamageControl::Tracker::SourceForge

Inherits:
Base
  • Object
show all
Defined in:
lib/damagecontrol/tracker.rb

Direct Known Subclasses

RubyForge

Constant Summary collapse

PATTERN =
/#([0-9]+)/

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(group_id = "", tracker_id = "") ⇒ SourceForge

Returns a new instance of SourceForge.



136
137
138
# File 'lib/damagecontrol/tracker.rb', line 136

def initialize(group_id="", tracker_id="")
  @group_id, @tracker_id = group_id, tracker_id
end

Instance Attribute Details

#group_idObject

Returns the value of attribute group_id.



130
131
132
# File 'lib/damagecontrol/tracker.rb', line 130

def group_id
  @group_id
end

#tracker_idObject

Returns the value of attribute tracker_id.



134
135
136
# File 'lib/damagecontrol/tracker.rb', line 134

def tracker_id
  @tracker_id
end

Instance Method Details

#highlight(message) ⇒ Object



148
149
150
# File 'lib/damagecontrol/tracker.rb', line 148

def highlight(message)
  htmlize(message.gsub(PATTERN,"<a href=\"http://sourceforge.net/tracker/index.php?func=detail&aid=\\1&group_id=#{group_id}&atid=#{tracker_id}\">#\\1</a>"))
end

#nameObject



140
141
142
# File 'lib/damagecontrol/tracker.rb', line 140

def name
  "SourceForge"
end

#urlObject



144
145
146
# File 'lib/damagecontrol/tracker.rb', line 144

def url
  "http://sourceforge.net/tracker/?group_id=#{group_id}"
end