Module: Ronin::CLI::TypoOptions Private
- Included in:
- Commands::Typo, Commands::Typosquat
- Defined in:
- lib/ronin/cli/typo_options.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Adds options for enabling typo generator rules.
Options
--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
Class Method Summary collapse
-
.included(command) ⇒ Object
private
Adds typo options to the command.
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ Object
private
Initializes the command.
-
#typo_generator ⇒ Ronin::Support::Text::Typo::Generator
private
The typo generator.
Class Method Details
.included(command) ⇒ 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.
Adds typo options to the command.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ronin/cli/typo_options.rb', line 40 def self.included(command) command.option :omit_chars, desc: 'Toggles whether to omit repeated characters' do @typo_kwargs[:emit_chars] = true end command.option :repeat_chars, desc: 'Toggles whether to repeat single characters' do @typo_kwargs[:repeat_chars] = true end command.option :swap_chars, desc: 'Toggles whether to swap certain common character pairs' do @typo_kwargs[:swap_chars] = true end command.option :change_suffix, desc: 'Toggles whether to change the suffix of words' do @typo_kwargs[:change_suffix] = true end end |
Instance Method Details
#initialize(**kwargs) ⇒ 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.
Initializes the command.
64 65 66 67 68 |
# File 'lib/ronin/cli/typo_options.rb', line 64 def initialize(**kwargs) super(**kwargs) @typo_kwargs = {} end |
#typo_generator ⇒ Ronin::Support::Text::Typo::Generator
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.
The typo generator.
75 76 77 |
# File 'lib/ronin/cli/typo_options.rb', line 75 def typo_generator @typo_generator ||= Support::Text::Typo.generator(**@typo_kwargs) end |