Module: Ronin::Core::CLI::Generator::ClassMethods

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

Overview

Class-methods.

Instance Method Summary collapse

Instance Method Details

#template_dir(path = nil) ⇒ String

Gets or sets the template directory.

Examples:

template_dir File.join(__dir__,'..','..','..','..','data','templates','thing')

Parameters:

  • path (String, nil) (defaults to: nil)

    If a path is given, the template directory will be set.

Returns:

  • (String)

    The set template directory.

Raises:



81
82
83
84
85
86
87
# File 'lib/ronin/core/cli/generator.rb', line 81

def template_dir(path=nil)
  if path
    @template_dir = File.expand_path(path)
  else
    @template_dir || (superclass.template_dir if superclass.kind_of?(ClassMethods))
  end
end