Class: Avm::SourceGenerators::Base

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

Instance Method Summary collapse

Methods included from With::ApplicationStereotype

#stereotype_namespace_module

Instance Method Details

#apply_templateObject



24
25
26
# File 'lib/avm/source_generators/base.rb', line 24

def apply_template
  template.apply(self, target_path)
end

#assert_clear_directoryObject



19
20
21
22
# File 'lib/avm/source_generators/base.rb', line 19

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

#performObject



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

def perform
  assert_clear_directory
  apply_template
end