Class: ScmWeb::ViewCvs
Overview
The variables to use in uri_specs are:
-
path
-
revision
-
previous_revision
Instance Attribute Summary collapse
-
#cvs_host_name ⇒ Object
Returns the value of attribute cvs_host_name.
-
#cvs_server_path ⇒ Object
Returns the value of attribute cvs_server_path.
-
#module_regexp ⇒ Object
Returns the value of attribute module_regexp.
-
#project_unix_name ⇒ Object
Returns the value of attribute project_unix_name.
-
#uri_specs ⇒ Object
Returns the value of attribute uri_specs.
Instance Method Summary collapse
-
#initialize(uri_specs = nil, cvs_host_name = nil, cvs_server_path = nil, project_unix_name = nil, module_regexp = nil) ⇒ ViewCvs
constructor
A new instance of ViewCvs.
- #scms ⇒ Object
-
#uri(path = "", options = {:type=>"overview"}) ⇒ Object
Returns the URI for the file at
path
.
Methods inherited from Base
Constructor Details
#initialize(uri_specs = nil, cvs_host_name = nil, cvs_server_path = nil, project_unix_name = nil, module_regexp = nil) ⇒ ViewCvs
Returns a new instance of ViewCvs.
12 13 14 15 |
# File 'lib/scm_web/view_cvs.rb', line 12 def initialize(uri_specs=nil, cvs_host_name=nil, cvs_server_path=nil, project_unix_name=nil, module_regexp=nil) @uri_specs, @cvs_host_name, @cvs_server_path, @project_unix_name, @module_regexp = uri_specs, cvs_host_name, cvs_server_path, project_unix_name, module_regexp end |
Instance Attribute Details
#cvs_host_name ⇒ Object
Returns the value of attribute cvs_host_name.
10 11 12 |
# File 'lib/scm_web/view_cvs.rb', line 10 def cvs_host_name @cvs_host_name end |
#cvs_server_path ⇒ Object
Returns the value of attribute cvs_server_path.
10 11 12 |
# File 'lib/scm_web/view_cvs.rb', line 10 def cvs_server_path @cvs_server_path end |
#module_regexp ⇒ Object
Returns the value of attribute module_regexp.
10 11 12 |
# File 'lib/scm_web/view_cvs.rb', line 10 def module_regexp @module_regexp end |
#project_unix_name ⇒ Object
Returns the value of attribute project_unix_name.
10 11 12 |
# File 'lib/scm_web/view_cvs.rb', line 10 def project_unix_name @project_unix_name end |
#uri_specs ⇒ Object
Returns the value of attribute uri_specs.
10 11 12 |
# File 'lib/scm_web/view_cvs.rb', line 10 def uri_specs @uri_specs end |
Instance Method Details
#scms ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/scm_web/view_cvs.rb', line 17 def scms unless(@scms) require 'rscm' @scms = [] cvs_root = open(uri) do |data| data.each_line do |line| if line =~ @module_regexp mod = $1 unless(mod == "CVSROOT") scm = RSCM::Cvs.new scm.root = ":pserver:anonymous@#{cvs_host_name}:#{cvs_server_path}/#{mod}" #TODO: is this right? scm.mod = mod @scms << scm end end end end end @scms end |
#uri(path = "", options = {:type=>"overview"}) ⇒ Object
Returns the URI for the file at path
. Options are:
:type (can be one of :overview, :raw or :html)
:revision (the revision of the file. must be specified when :type is :raw or :html)
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/scm_web/view_cvs.rb', line 43 def uri(path="", ={:type=>"overview"}) type = [:type] raise "No :type specified" unless type uri_spec = @uri_specs[type] raise "No uri_spec for #{type}" unless uri_spec project_unix_name = @project_unix_name revision = [:revision] previous_revision = [:previous_revision] eval("\"#{uri_spec}\"", binding) end |