Class: MetaProject::Tracker::Trac::TracTracker
- Includes:
- DigitIssues
- Defined in:
- lib/meta_project/tracker/trac/trac_tracker.rb
Instance Attribute Summary collapse
-
#trac_base_url ⇒ Object
Returns the value of attribute trac_base_url.
Instance Method Summary collapse
-
#initialize(trac_base_url = nil) ⇒ TracTracker
constructor
A new instance of TracTracker.
- #materialize(issue) ⇒ Object
- #overview ⇒ Object
Methods included from DigitIssues
command_pattern, #identifier_examples, issue_pattern, #markup
Methods inherited from Base
Constructor Details
#initialize(trac_base_url = nil) ⇒ TracTracker
Returns a new instance of TracTracker.
9 10 11 |
# File 'lib/meta_project/tracker/trac/trac_tracker.rb', line 9 def initialize(trac_base_url=nil) @trac_base_url = trac_base_url end |
Instance Attribute Details
#trac_base_url ⇒ Object
Returns the value of attribute trac_base_url.
7 8 9 |
# File 'lib/meta_project/tracker/trac/trac_tracker.rb', line 7 def trac_base_url @trac_base_url end |
Instance Method Details
#materialize(issue) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/meta_project/tracker/trac/trac_tracker.rb', line 17 def materialize(issue) begin url = "#{@trac_base_url}/ticket/#{issue.identifier}" html = better_open(url).read summary = html[/Ticket ##{issue.identifier}\s*<\/h1>\s*<h2>([^<]*)<\/h2>/n, 1] issue.attributes[:summary] = summary issue.attributes[:url] = url rescue OpenURI::HTTPError => e STDERR.puts e. end issue end |
#overview ⇒ Object
13 14 15 |
# File 'lib/meta_project/tracker/trac/trac_tracker.rb', line 13 def overview "#{@trac_base_url}/report" end |