parent
714fc83cfe
commit
e9b183cda2
|
@ -103,17 +103,21 @@ module Anemone
|
|||
@links = run_extractors
|
||||
|
||||
@links |= @links.map do |u|
|
||||
# back-off to the parent dir
|
||||
# back-off to the parent dir
|
||||
to_absolute( URI( u.path.gsub( /(.*\/)[^\/]+$/, "\\1" ) ) ) rescue next
|
||||
end.uniq.compact
|
||||
|
||||
@links |= @links.map do |u|
|
||||
bits = u.path.split( '/' )
|
||||
while bits.length > 0
|
||||
bits.pop
|
||||
to_absolute( URI( bits.join( '/' ) ) ) rescue next
|
||||
end
|
||||
end.uniq.compact
|
||||
nlinks = []
|
||||
@links.each do |u|
|
||||
bits = u.path.split('/')
|
||||
while(bits.length > 0)
|
||||
bits.pop
|
||||
j = bits.join('/')
|
||||
j = '/' if j.empty?
|
||||
nlinks << to_absolute(URI(j)) rescue next
|
||||
end
|
||||
end
|
||||
@links |= nlinks
|
||||
|
||||
@links.flatten!
|
||||
@links.uniq!
|
||||
|
|
Loading…
Reference in New Issue