File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -103,17 +103,21 @@ def links
103
103
@links = run_extractors
104
104
105
105
@links |= @links . map do |u |
106
- # back-off to the parent dir
106
+ # back-off to the parent dir
107
107
to_absolute ( URI ( u . path . gsub ( /(.*\/ )[^\/ ]+$/ , "\\ 1" ) ) ) rescue next
108
108
end . uniq . compact
109
109
110
- @links |= @links . map do |u |
111
- bits = u . path . split ( '/' )
112
- while bits . length > 0
113
- bits . pop
114
- to_absolute ( URI ( bits . join ( '/' ) ) ) rescue next
115
- end
116
- end . uniq . compact
110
+ nlinks = [ ]
111
+ @links . each do |u |
112
+ bits = u . path . split ( '/' )
113
+ while ( bits . length > 0 )
114
+ bits . pop
115
+ j = bits . join ( '/' )
116
+ j = '/' if j . empty?
117
+ nlinks << to_absolute ( URI ( j ) ) rescue next
118
+ end
119
+ end
120
+ @links |= nlinks
117
121
118
122
@links . flatten!
119
123
@links . uniq!
You can’t perform that action at this time.
0 commit comments