Class: Avm::SourceGenerators::Base

Inherits:
Object
  • Object
show all
Includes:
With::ApplicationStereotype
Defined in:
lib/avm/source_generators/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from With::ApplicationStereotype

#stereotype_namespace_module

Class Method Details

.option_listAvm::SourceGenerators::OptionList



15
16
17
# File 'lib/avm/source_generators/base.rb', line 15

def option_list
  Avm::SourceGenerators::OptionList.new
end

Instance Method Details

#apply_templateObject



40
41
42
# File 'lib/avm/source_generators/base.rb', line 40

def apply_template
  template.apply(self, target_path)
end

#assert_clear_directoryObject



35
36
37
38
# File 'lib/avm/source_generators/base.rb', line 35

def assert_clear_directory
  target_path.mkpath
  raise "\"#{target_path}\" is not empty" if target_path.children.any?
end

#option_listAvm::SourceGenerators::OptionList



26
27
28
# File 'lib/avm/source_generators/base.rb', line 26

def option_list
  self.class.option_list
end

#performObject



30
31
32
33
# File 'lib/avm/source_generators/base.rb', line 30

def perform
  assert_clear_directory
  apply_template
end