Skip to content

Instantly share code, notes, and snippets.

@lcw
Created September 13, 2009 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lcw/186314 to your computer and use it in GitHub Desktop.
Save lcw/186314 to your computer and use it in GitHub Desktop.
def file_listings(project_id)
@results = @client.get_content("https://#{@host}/projects/#{project_id}/files")
@doc = Hpricot(@results)
a = (@doc/"div.file"/"div.file_info"/"h1"/"a").map{|f| f["href"]}
a += (@doc/"div.file"/"div.file_info"/"div.versions"/"h3"/"a").map{|f| f["href"]}.delete_if {|x| x == "#"}
return a
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment