Module: Gobuster::Parsers::S3

Defined in:
lib/gobuster/parsers/s3.rb

Class Method Summary collapse

Class Method Details

.parse(io) {|s3bucket| ... } ⇒ Enumerator

Parses gobuster s3 output.

Parameters:

  • io (IO)

    The IO stream to parse.

Yields:

  • (s3bucket)

    The given block will be passed each parsed s3bucket.

Yield Parameters:

  • s3bucket (S3Bucket)

    The parsed s3bucket.

Returns:

  • (Enumerator)

    If no block is given, an Enumerator will be returned.



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/gobuster/parsers/s3.rb', line 21

def self.parse(io)
  return enum_for(__method__,io) unless block_given?

  io.each_line do |line|
    line.chomp!

    if line.start_with?('http://') && line.end_with?('s3.amazonaws.com/')
      yield S3Bucket.new(line)
    end
  end
end