Module: Avm::Rspec::Setup::SourceGenerator

Defined in:
lib/avm/rspec/setup/source_generator.rb

Constant Summary collapse

DEFAULT_TARGET_BASENAME =
'generated_app'

Instance Method Summary collapse

Instance Method Details

#avm_source(stereotype_name, options = {}) ⇒ Avm::Sources::Base

Returns:



12
13
14
15
16
17
18
# File 'lib/avm/rspec/setup/source_generator.rb', line 12

def avm_source(stereotype_name, options = {})
  options = options.dup
  target_basename ||= options.delete(:target_basename) || DEFAULT_TARGET_BASENAME
  target_path ||= options.delete(:target_path) || temp_dir.join(target_basename)
  ::Avm::Registry.source_generators.detect(stereotype_name, target_path, options).perform
  ::Avm::Registry.sources.detect(target_path)
end