Class: ChkBuild::ViewVC
- Inherits:
-
Object
- Object
- ChkBuild::ViewVC
- Defined in:
- lib/chkbuild/scm/svn.rb
Instance Method Summary collapse
- #diff_uri(d, f, r1, r2) ⇒ Object
- #dir_uri(d, f, r) ⇒ Object
- #extend_uri(path, params) ⇒ Object
-
#initialize(uri, old = false) ⇒ ViewVC
constructor
A new instance of ViewVC.
- #markup_uri(d, f, r) ⇒ Object
- #rev_uri(r) ⇒ Object
Constructor Details
#initialize(uri, old = false) ⇒ ViewVC
Returns a new instance of ViewVC.
31 32 33 34 |
# File 'lib/chkbuild/scm/svn.rb', line 31 def initialize(uri, old=false) @uri = uri @old = old end |
Instance Method Details
#diff_uri(d, f, r1, r2) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/chkbuild/scm/svn.rb', line 51 def diff_uri(d, f, r1, r2) pathrev = @old ? 'rev' : 'pathrev' extend_uri("/#{d}/#{f}", [ ['p1', "#{d}/#{f}"], ['r1', r1.to_s], ['r2', r2.to_s], [pathrev, r2.to_s]]).to_s end |
#dir_uri(d, f, r) ⇒ Object
46 47 48 49 |
# File 'lib/chkbuild/scm/svn.rb', line 46 def dir_uri(d, f, r) pathrev = @old ? 'rev' : 'pathrev' extend_uri("/#{d}/#{f}", [[pathrev, r.to_s]]).to_s end |
#extend_uri(path, params) ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/chkbuild/scm/svn.rb', line 60 def extend_uri(path, params) uri = URI.parse(@uri) uri.path = uri.path + Escape.uri_path(path).to_s query = Escape.html_form(params).to_s (uri.query || '').split(/[;&]/).each {|param| query << ';' << param } uri.query = query uri end |
#markup_uri(d, f, r) ⇒ Object
41 42 43 44 |
# File 'lib/chkbuild/scm/svn.rb', line 41 def markup_uri(d, f, r) pathrev = @old ? 'rev' : 'pathrev' extend_uri("/#{d}/#{f}", [['view', 'markup'], [pathrev, r.to_s]]).to_s end |
#rev_uri(r) ⇒ Object
36 37 38 39 |
# File 'lib/chkbuild/scm/svn.rb', line 36 def rev_uri(r) revision = @old ? 'rev' : 'revision' extend_uri("", [['view', 'rev'], [revision, r.to_s]]).to_s end |