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.7.4 lib/power_stencil/engine/base.rb
power_stencil-0.7.3 lib/power_stencil/engine/base.rb
power_stencil-0.7.2 lib/power_stencil/engine/base.rb
power_stencil-0.7.1 lib/power_stencil/engine/base.rb
power_stencil-0.7.0 lib/power_stencil/engine/base.rb
power_stencil-0.6.3 lib/power_stencil/engine/base.rb
power_stencil-0.6.2 lib/power_stencil/engine/base.rb
power_stencil-0.6.1 lib/power_stencil/engine/base.rb
power_stencil-0.6.0 lib/power_stencil/engine/base.rb
power_stencil-0.5.1 lib/power_stencil/engine/base.rb
power_stencil-0.5.0 lib/power_stencil/engine/base.rb
power_stencil-0.4.22 lib/power_stencil/engine/base.rb
power_stencil-0.4.21 lib/power_stencil/engine/base.rb
power_stencil-0.4.20 lib/power_stencil/engine/base.rb
power_stencil-0.4.19 lib/power_stencil/engine/base.rb
power_stencil-0.4.18 lib/power_stencil/engine/base.rb
power_stencil-0.4.17 lib/power_stencil/engine/base.rb
power_stencil-0.4.16 lib/power_stencil/engine/base.rb
power_stencil-0.4.15 lib/power_stencil/engine/base.rb
power_stencil-0.4.14 lib/power_stencil/engine/base.rb