Sha256: 62c8e30f2beab10730caaea5c6560977b589a1c387ebc9a2ca95d432fabc45f8

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

require "pathname"

require_relative "domain_config"

module Foobara
  module Generators
    module DomainGenerator
      class GenerateDomain < Foobara::Generators::Generate
        class MissingManifestError < RuntimeError; end

        possible_error MissingManifestError

        inputs DomainConfig

        def execute
          add_initial_elements_to_generate

          each_element_to_generate do
            generate_element
          end

          paths_to_source_code
        end

        attr_accessor :manifest_data

        def base_generator
          Generators::DomainGenerator
        end

        # TODO: delegate this to base_generator
        def templates_dir
          # TODO: implement this?
          # :nocov:
          "#{__dir__}/../templates"
          # :nocov:
        end

        def add_initial_elements_to_generate
          elements_to_generate << domain_config
        end

        def domain_config
          @domain_config ||= DomainConfig.new(inputs)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foobara-domain-generator-0.0.2 src/generate_domain.rb
foobara-domain-generator-0.0.1 src/generate_domain.rb