improve more
This commit is contained in:
parent
6fa1a57fda
commit
d9fbba0c0b
1 changed files with 7 additions and 6 deletions
|
|
@ -81,9 +81,10 @@ def fetch(uri_str, limit = 10)
|
|||
case response
|
||||
when Net::HTTPSuccess then response
|
||||
when Net::HTTPRedirection then fetch(response['location'], limit - 1)
|
||||
when Net::HTTPNotFound then puts "404 Not Found #{uri_str}"; response.error!
|
||||
when Net::HTTPUnauthorized then puts "401 Authorization Required #{uri_str}"; response.error!
|
||||
when Net::HTTPUnauthorized then puts "401 Authorization Required #{uri_str}"; response.error!
|
||||
when Net::HTTPUnauthorized then puts "401 Authorization Required #{uri_str}"
|
||||
when Net::HTTPUnauthorized then puts "401 Authorization Required #{uri_str}"
|
||||
when Net::HTTPForbidden then puts "403 Forbidden #{uri_str}"
|
||||
when Net::HTTPNotFound then puts "404 Not Found #{uri_str}"
|
||||
else
|
||||
response.error!
|
||||
end
|
||||
|
|
@ -156,7 +157,9 @@ def cvsparse(url)
|
|||
begin
|
||||
body = fetch("#{url}/CVS/Entries").body
|
||||
rescue
|
||||
p $!
|
||||
end
|
||||
if body.nil?
|
||||
return
|
||||
end
|
||||
dirs = Array.new
|
||||
body.each{|line|
|
||||
|
|
@ -192,7 +195,6 @@ if mode.nil?
|
|||
body = fetch("#{options["-u"]}/.svn/entries").body
|
||||
mode="subversion"
|
||||
rescue
|
||||
p $!
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -202,7 +204,6 @@ if mode.nil?
|
|||
body = fetch("#{options["-u"]}/CVS/Entries").body
|
||||
mode="cvs"
|
||||
rescue
|
||||
p $!
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue