Method: Wordlist::File.read

Defined in:
lib/wordlist/file.rb

.read(path, **kwargs) {|word| ... } ⇒ Enumerator

Opens and reads the wordlist file.

Parameters:

  • path (String)

    The path to the .txt file wordlist read from.

Yields:

  • (word)

    The given block will be passed every word from the wordlist.

Yield Parameters:

  • word (String)

    A word from the wordlist.

Returns:

  • (Enumerator)

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

Since:

  • 1.0.0



101
102
103
# File 'lib/wordlist/file.rb', line 101

def self.read(path,**kwargs,&block)
  open(path,**kwargs).each(&block)
end