continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r943854 - /continuum/sandbox/continuum-ruby/lib/continuum/working_copy.rb
Date Thu, 13 May 2010 09:21:41 GMT
Author: carlos
Date: Thu May 13 09:21:40 2010
New Revision: 943854

URL: http://svn.apache.org/viewvc?rev=943854&view=rev
Log:
Add code comments

Modified:
    continuum/sandbox/continuum-ruby/lib/continuum/working_copy.rb

Modified: continuum/sandbox/continuum-ruby/lib/continuum/working_copy.rb
URL: http://svn.apache.org/viewvc/continuum/sandbox/continuum-ruby/lib/continuum/working_copy.rb?rev=943854&r1=943853&r2=943854&view=diff
==============================================================================
--- continuum/sandbox/continuum-ruby/lib/continuum/working_copy.rb (original)
+++ continuum/sandbox/continuum-ruby/lib/continuum/working_copy.rb Thu May 13 09:21:40 2010
@@ -34,6 +34,7 @@ module Continuum
       @login_url = "#{@continuum_url}/security/login.action"
     end
 
+    # get the file names in a directory for a particular project
     def dir(project_id, dir)
       page = get_page working_copy_url(project_id, dir)
       dir_contents = Nokogiri::HTML(page.body).search(".//table[@class='tableRegion']//a[contains(@href,'#{dir}')]")
@@ -43,6 +44,7 @@ module Continuum
       return file_names
     end
 
+    # download a working copy file
     def get(project_id, dir, file)
       page = get_page(working_copy_url(project_id, dir, file, "workingCopy")) # binary file
       if (!page.instance_of? WWW::Mechanize::File)
@@ -54,6 +56,7 @@ module Continuum
 
     private
 
+    # get the url for a working copy dir or file
     def working_copy_url(project_id, dir, file = nil, action = "workingCopyFileText")
       action = file.nil? ? "workingCopy" : action
       url = "#{@continuum_url}/#{action}.action?projectId=#{project_id}&userDirectory=#{dir}"
@@ -61,6 +64,7 @@ module Continuum
       return url
     end
 
+    # fetch a page, authenticating if necessary
     def get_page(url)
       mechanize = WWW::Mechanize.new
       page = mechanize.get(url)



Mime
View raw message