Class: Ronin::CLI::Commands::Homoglyph Private

Inherits:
ValueProcessorCommand show all
Defined in:
lib/ronin/cli/commands/homoglyph.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 homoglyph equivalent words.

Usage

ronin homoglyph [options] [WORD ...]

Options

-f, --file FILE                  Optional file to process
-C ascii|greek|cyrillic|punctuation|latin_numbers|full_width,
    --char-set                   Selects the homoglyph character set
-E, --enum                       Enumerates over every possible typo of a word
-h, --help                       Print help information

Arguments

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

Since:

  • 2.0.0

Instance Attribute Summary

Attributes inherited from ValueProcessorCommand

#files

Instance Method Summary collapse

Methods inherited from ValueProcessorCommand

#initialize, #process_file

Constructor Details

This class inherits a constructor from Ronin::CLI::ValueProcessorCommand

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 homoglyph.

Since:

  • 2.0.0



85
86
87
88
89
90
91
92
93
# File 'lib/ronin/cli/commands/homoglyph.rb', line 85

def process_value(word)
  if options[:enum]
    @table.each_substitution(word) do |homoglyphed_word|
      puts homoglyphed_word
    end
  else
    puts @table.substitute(word)
  end
end

#run(*words) ⇒ 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.

Runs the ronin homoglyph command.

Parameters:

  • words (Array<String>)

    The words to homoglyph.

Since:

  • 2.0.0



73
74
75
76
77
# File 'lib/ronin/cli/commands/homoglyph.rb', line 73

def run(*words)
  @table = Support::Text::Homoglyph.table(options[:char_set])

  super(*words)
end