Module: Ronin::Core::CLI::Generator::Options::Reference

Defined in:
lib/ronin/core/cli/generator/options/reference.rb

Overview

Adds the -R,--reference URL option to the generator command.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#referencesArray<String> (readonly)

The reference URLs to output.

Returns:

  • (Array<String>)


42
43
44
# File 'lib/ronin/core/cli/generator/options/reference.rb', line 42

def references
  @references
end

Class Method Details

.included(command) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/ronin/core/cli/generator/options/reference.rb', line 28

def self.included(command)
  command.option :reference, short: '-R',
                             value: {
                               type: String,
                               usage: 'URL'
                             },
                             desc: 'Adds a reference URL' do |url|
                               @references << url
                             end
end

Instance Method Details

#initialize(**kwargs) ⇒ Object

Initializes #references.

Parameters:

  • kwargs (Hash{Symbol => Object})

    Additional keyword arguments.



50
51
52
53
54
# File 'lib/ronin/core/cli/generator/options/reference.rb', line 50

def initialize(**kwargs)
  super(**kwargs)

  @references = []
end