Class: Ronin::CLI::Commands::Typo Private

Inherits:
ValueProcessorCommand show all
Includes:
TypoOptions
Defined in:
lib/ronin/cli/commands/typo.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Generates typos in words.

Usage

ronin typo [options] [WORD ...]

Options

-f, --file FILE                  Optional file to process
    --omit-chars                 Toggles whether to omit repeated characters
    --repeat-chars               Toggles whether to repeat single characters
    --swap-chars                 Toggles whether to swap certain common character pairs
    --change-suffix              Toggles whether to change the suffix of words
-E, --enum                       Enumerates over every possible typo of a word
-h, --help                       Print help information

Arguments

[WORD ...]                       Optional word(s) to typo

Since:

  • 2.0.0

Instance Attribute Summary

Attributes inherited from ValueProcessorCommand

#files

Instance Method Summary collapse

Methods included from TypoOptions

included, #initialize, #typo_generator

Methods inherited from ValueProcessorCommand

#initialize, #process_file, #run

Instance Method Details

#process_value(word) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Processes each word.

Parameters:

  • word (String)

    A word argument to typo.

Since:

  • 2.0.0



67
68
69
70
71
72
73
74
75
# File 'lib/ronin/cli/commands/typo.rb', line 67

def process_value(word)
  if options[:enum]
    typo_generator.each_substitution(word) do |typo|
      puts typo
    end
  else
    puts typo_generator.substitute(word)
  end
end