Sha256: 6fcc7c4e1be46f14a62e1bc5c4dc4edd1813713b4132b87f6ee9cfc8c1b7befa

Contents?: true

Size: 1.24 KB

Versions: 44

Compression:

Stored size: 1.24 KB

Contents

require 'power_stencil/engine/entities_definitions'
require 'power_stencil/engine/directory_processor'

require 'power_stencil/engine/renderers/erb'
require 'power_stencil/dsl/base'
require 'power_stencil/dsl/plugin_generation'

module PowerStencil
  module Engine

    class Base

      UNIVERSE_BASENAME = 'Project entities'.freeze

      include Climatic::Proxy
      include PowerStencil::Engine::EntitiesDefinition
      include PowerStencil::Engine::DirectoryProcessor

      include PowerStencil::Engine::Renderers::Erb

      attr_accessor :dsl
      attr_reader :root_universe

      def initialize(universe = UniverseCompiler::Universe::Base.new(unique_name))
        @root_universe = universe
        @dsl = PowerStencil::Dsl::Base
      end

      def running_context(universe = root_universe, main_entry_point: nil)
        context = dsl.new universe
        context.main_entry_point = main_entry_point
        context.instance_eval do
          binding
        end
      end

      protected

      def load_system_entities
        root_universe << PowerStencil::SystemEntityDefinitions::ProjectConfig.new(fields: PowerStencil.config[])
      end

      def unique_name
        '%s (%f)' % [UNIVERSE_BASENAME, Time.now.to_f]
      end

    end

  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
power_stencil-0.4.13 lib/power_stencil/engine/base.rb
power_stencil-0.4.12 lib/power_stencil/engine/base.rb
power_stencil-0.4.11 lib/power_stencil/engine/base.rb
power_stencil-0.4.10 lib/power_stencil/engine/base.rb
power_stencil-0.4.9 lib/power_stencil/engine/base.rb
power_stencil-0.4.8 lib/power_stencil/engine/base.rb
power_stencil-0.4.7 lib/power_stencil/engine/base.rb
power_stencil-0.4.6 lib/power_stencil/engine/base.rb
power_stencil-0.4.5 lib/power_stencil/engine/base.rb
power_stencil-0.4.4 lib/power_stencil/engine/base.rb
power_stencil-0.4.3 lib/power_stencil/engine/base.rb
power_stencil-0.4.2 lib/power_stencil/engine/base.rb
power_stencil-0.4.1 lib/power_stencil/engine/base.rb
power_stencil-0.4.0 lib/power_stencil/engine/base.rb
power_stencil-0.3.9 lib/power_stencil/engine/base.rb
power_stencil-0.3.8 lib/power_stencil/engine/base.rb
power_stencil-0.3.7 lib/power_stencil/engine/base.rb
power_stencil-0.3.6 lib/power_stencil/engine/base.rb
power_stencil-0.3.5 lib/power_stencil/engine/base.rb
power_stencil-0.3.4 lib/power_stencil/engine/base.rb