Class: XForge::SourceForge

Inherits:
Host
  • Object
show all
Defined in:
lib/xforge/sourceforge.rb

Constant Summary collapse

VIEW_CVS =
"http://cvs.sourceforge.net/viewcvs.py/"
PROJECT_PATH =
"\#{project_unix_name}/\#{path}"
REV =
"rev=\#{revision}"
OVERVIEW =
"#{VIEW_CVS}#{PROJECT_PATH}"
RAW =
"#{VIEW_CVS}*checkout*/#{PROJECT_PATH}?#{REV}"
HTML =
"#{OVERVIEW}?#{REV}&view=markup"
DIFF =
"#{OVERVIEW}?r1=\#{previous_revision}&r2=\#{revision}"

Instance Attribute Summary

Attributes inherited from Host

#name

Instance Method Summary collapse

Methods inherited from Host

#project

Constructor Details

#initializeSourceForge

Returns a new instance of SourceForge.



12
13
14
# File 'lib/xforge/sourceforge.rb', line 12

def initialize
  super("sourceforge.net")
end

Instance Method Details

#cvs_host_nameObject



24
25
26
# File 'lib/xforge/sourceforge.rb', line 24

def cvs_host_name
  "cvs.sourceforge.net"
end

#cvs_server_pathObject



20
21
22
# File 'lib/xforge/sourceforge.rb', line 20

def cvs_server_path
  "/cvsroot"
end

#home_page_regexpObject

Regexp used to find projects’ home page



40
41
42
43
# File 'lib/xforge/sourceforge.rb', line 40

def home_page_regexp
  # This seems a little volatile
  /<A href=\"(\w*:\/\/[^\"]*)\">&nbsp;Project Home Page<\/A>/
end

#login_portObject



16
17
18
# File 'lib/xforge/sourceforge.rb', line 16

def 
  443
end

#scm_web(project) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/xforge/sourceforge.rb', line 28

def scm_web(project)
  module_regexp = /viewcvs\.py\/#{project.unix_name}\/(\w+)\//
  ::ScmWeb::ViewCvs.new(
    {"overview" => OVERVIEW, "raw" => RAW, "html" => HTML, "diff" => DIFF}, 
    cvs_host_name,
    cvs_server_path,
    project.unix_name,
    module_regexp
  )
end