Class: Tracker::Trac::TracProject
- Includes:
- ScmWeb::FileUri, DigitIssues
- Defined in:
- lib/tracker/trac/project.rb
Constant Summary collapse
- OVERVIEW =
"\#{@uri}/log/\#{@svn_path}/\#{path}"
- HTML =
"\#{@uri}/file/\#{@svn_path}/\#{path}?rev=\#{revision}"
- RAW =
"#{HTML}&format=txt"
- DIFF =
"\#{@uri}/changeset/\#{revision}"
- URI_SPECS =
{"overview" => OVERVIEW, "raw" => RAW, "html" => HTML, "diff" => DIFF}
Instance Attribute Summary collapse
-
#svn_path ⇒ Object
Returns the value of attribute svn_path.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(uri = nil, svn_path = nil) ⇒ TracProject
constructor
A new instance of TracProject.
- #issue(issue_identifier) ⇒ Object
- #uri_specs ⇒ Object
Methods included from ScmWeb::FileUri
Methods included from DigitIssues
#identifier_examples, #identifier_regexp, #markup
Methods inherited from Base
Constructor Details
#initialize(uri = nil, svn_path = nil) ⇒ TracProject
Returns a new instance of TracProject.
8 9 10 |
# File 'lib/tracker/trac/project.rb', line 8 def initialize(uri=nil, svn_path=nil) @uri, @svn_path = uri, svn_path end |
Instance Attribute Details
#svn_path ⇒ Object
Returns the value of attribute svn_path.
7 8 9 |
# File 'lib/tracker/trac/project.rb', line 7 def svn_path @svn_path end |
#uri ⇒ Object
Returns the value of attribute uri.
7 8 9 |
# File 'lib/tracker/trac/project.rb', line 7 def uri @uri end |
Instance Method Details
#issue(issue_identifier) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/tracker/trac/project.rb', line 12 def issue(issue_identifier) issue_uri = "#{@uri}/ticket/#{issue_identifier}" begin html = open(issue_uri) { |data| data.read } summary = html[/Ticket ##{issue_identifier}\s*<\/h1>\s*<h2>([^<]*)<\/h2>/n, 1] Issue.new(issue_uri, summary) rescue OpenURI::HTTPError nil end end |
#uri_specs ⇒ Object
29 30 31 |
# File 'lib/tracker/trac/project.rb', line 29 def uri_specs URI_SPECS end |