Class: Potassium::RecipeGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/potassium/generators/recipe.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.cli_optionsObject

Returns the value of attribute cli_options.



13
14
15
# File 'lib/potassium/generators/recipe.rb', line 13

def cli_options
  @cli_options
end

Instance Method Details

#run_generatorObject



16
17
18
19
20
21
# File 'lib/potassium/generators/recipe.rb', line 16

def run_generator
  require_relative "../helpers/template-dsl"
  TemplateDSL.extend_dsl(self, source_path: __FILE__)
  template_location = File.expand_path('../templates/recipe.rb', File.dirname(__FILE__))
  instance_eval File.read(template_location), template_location
end