Module: Gobuster::Parsers::Dir
- Defined in:
- lib/gobuster/parsers/dir.rb
Class Method Summary collapse
-
.parse(io) {|response| ... } ⇒ Enumerator
Parses
gobuster dir
output.
Class Method Details
.parse(io) {|response| ... } ⇒ Enumerator
Parses gobuster dir
output.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/gobuster/parsers/dir.rb', line 21 def self.parse(io) return enum_for(__method__,io) unless block_given? line_regexp = /^(\/[^\s]+)\s+\(Status: (\d{3})\)\s+\[Size: (\d+)\]/ io.each_line do |line| if (match = line.match(line_regexp)) yield Response.new( path: match[1], status: match[2].to_i, size: match[3].to_i ) end end end |