Sha256: a0b5a971891f0614b8288da2a0815b3a3af40063e9e1e9b5c6912f4234041452

Contents?: true

Size: 1.28 KB

Versions: 15

Compression:

Stored size: 1.28 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'
require 'power_stencil/dsl/completion'

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

15 entries across 15 versions & 1 rubygems

Version Path
power_stencil-0.8.14 lib/power_stencil/engine/base.rb
power_stencil-0.8.13 lib/power_stencil/engine/base.rb
power_stencil-0.8.12 lib/power_stencil/engine/base.rb
power_stencil-0.8.11 lib/power_stencil/engine/base.rb
power_stencil-0.8.10 lib/power_stencil/engine/base.rb
power_stencil-0.8.9 lib/power_stencil/engine/base.rb
power_stencil-0.8.8 lib/power_stencil/engine/base.rb
power_stencil-0.8.7 lib/power_stencil/engine/base.rb
power_stencil-0.8.6 lib/power_stencil/engine/base.rb
power_stencil-0.8.5 lib/power_stencil/engine/base.rb
power_stencil-0.8.4 lib/power_stencil/engine/base.rb
power_stencil-0.8.3 lib/power_stencil/engine/base.rb
power_stencil-0.8.2 lib/power_stencil/engine/base.rb
power_stencil-0.8.1 lib/power_stencil/engine/base.rb
power_stencil-0.8.0 lib/power_stencil/engine/base.rb