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
|
case response
|
||||||
when Net::HTTPSuccess then response
|
when Net::HTTPSuccess then response
|
||||||
when Net::HTTPRedirection then fetch(response['location'], limit - 1)
|
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}"
|
||||||
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}"; response.error!
|
when Net::HTTPForbidden then puts "403 Forbidden #{uri_str}"
|
||||||
|
when Net::HTTPNotFound then puts "404 Not Found #{uri_str}"
|
||||||
else
|
else
|
||||||
response.error!
|
response.error!
|
||||||
end
|
end
|
||||||
|
|
@ -156,7 +157,9 @@ def cvsparse(url)
|
||||||
begin
|
begin
|
||||||
body = fetch("#{url}/CVS/Entries").body
|
body = fetch("#{url}/CVS/Entries").body
|
||||||
rescue
|
rescue
|
||||||
p $!
|
end
|
||||||
|
if body.nil?
|
||||||
|
return
|
||||||
end
|
end
|
||||||
dirs = Array.new
|
dirs = Array.new
|
||||||
body.each{|line|
|
body.each{|line|
|
||||||
|
|
@ -192,7 +195,6 @@ if mode.nil?
|
||||||
body = fetch("#{options["-u"]}/.svn/entries").body
|
body = fetch("#{options["-u"]}/.svn/entries").body
|
||||||
mode="subversion"
|
mode="subversion"
|
||||||
rescue
|
rescue
|
||||||
p $!
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -202,7 +204,6 @@ if mode.nil?
|
||||||
body = fetch("#{options["-u"]}/CVS/Entries").body
|
body = fetch("#{options["-u"]}/CVS/Entries").body
|
||||||
mode="cvs"
|
mode="cvs"
|
||||||
rescue
|
rescue
|
||||||
p $!
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue