Class: ScmWeb::ViewCvs

Inherits:
Base
  • Object
show all
Defined in:
lib/scm_web/view_cvs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

classes

Methods included from FileUri

#file_uri

Constructor Details

#initialize(uri_specs = {}, cvs_host_name = nil, cvs_server_path = nil, project_unix_name = nil, module_regexp = nil) ⇒ ViewCvs

Returns a new instance of ViewCvs.



6
7
8
9
# File 'lib/scm_web/view_cvs.rb', line 6

def initialize(uri_specs={}, 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_nameObject

Returns the value of attribute cvs_host_name.



4
5
6
# File 'lib/scm_web/view_cvs.rb', line 4

def cvs_host_name
  @cvs_host_name
end

#cvs_server_pathObject

Returns the value of attribute cvs_server_path.



4
5
6
# File 'lib/scm_web/view_cvs.rb', line 4

def cvs_server_path
  @cvs_server_path
end

#module_regexpObject

Returns the value of attribute module_regexp.



4
5
6
# File 'lib/scm_web/view_cvs.rb', line 4

def module_regexp
  @module_regexp
end

#project_unix_nameObject

Returns the value of attribute project_unix_name.



4
5
6
# File 'lib/scm_web/view_cvs.rb', line 4

def project_unix_name
  @project_unix_name
end

#uri_specsObject

The variables to use in uri_specs are:

  • path

  • revision

  • previous_revision



17
18
19
# File 'lib/scm_web/view_cvs.rb', line 17

def uri_specs
  @uri_specs
end

Instance Method Details

#scmsObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/scm_web/view_cvs.rb', line 21

def scms
  unless(@scms)
    require 'rscm'

    @scms = []
    cvs_root = open(file_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}"
            scm.mod = mod
            @scms << scm
          end
        end
      end
    end
  end
  @scms
end