Method: Wordlist::Compression::Writer.open

Defined in:
lib/wordlist/compression/writer.rb

.open(path, **kwargs) ⇒ IO

Opens the compressed wordlist for reading.

Parameters:

  • path (String)

    The path to the file.

  • kwargs (Hash{Symbol => Object})

    Additional keyword arguments for command.

Returns:

  • (IO)

    The uncompressed IO stream.

Raises:

  • (ArgumentError)

    The given format was not :gzip, :bzip2, :xz, :zip.

  • (CommandNotFound)

    The gzip, bzip2, xz, or zip command was not found on the system.

Since:

  • 1.0.0



80
81
82
83
84
85
86
87
88
# File 'lib/wordlist/compression/writer.rb', line 80

def self.open(path,**kwargs)
  command = self.command(path,**kwargs)

  begin
    IO.popen(command,'w')
  rescue Errno::ENOENT
    raise(CommandNotFound,"#{command.inspect} command not found")
  end
end