Sha256: a02e8d4fe89636bde0e9bc540446d5fd8b2c1a3d1bea848e89a05fe416b960bd

Contents?: true

Size: 1.22 KB

Versions: 3

Compression:

Stored size: 1.22 KB

Contents

#{{{ Require files
Rbbt.etc.requires.read.split("\n").each do |file|
  next if file.empty?
  Log.debug("requiring #{ file }")
  require file
end if Rbbt.etc.requires.exists?

Entity.entity_list_cache     = Rbbt.var.sinatra.find.entity_lists
Entity.entity_map_cache      = Rbbt.var.sinatra.find.entity_maps
Entity.entity_property_cache = Rbbt.var.sinatra.find.entity_properties

#{{{ Prepare REST entities
Rbbt.etc.entities.read.split("\n").each do |name|
  next if name.empty?
  mod = Kernel.const_get name
  Log.debug("Including Entity::REST for #{ name }")
  mod.module_eval do
    include Entity::REST
  end
end if Rbbt.etc.entities.exists?

#{{{ Prepare REST entity property persist
$annotation_repo = Rbbt.var.sinatra.annotation_repo.find
(Rbbt.etc.persist_properties.yaml || {}).each do |name,list|
  next if name.empty?
  mod = Kernel.const_get name
  mod.module_eval do
   list.each do |elem|
     prop, type, repo = elem.split(",").collect{|e| e.strip}

     Log.debug("Persist #{name} #{prop}: #{[type, repo].compact * ", "}")
     if repo == 'repo'
      options = {:annotation_repo => $annotation_repo}
     else
      options = {}
     end
     persist prop, type, options
   end
  end
end if Rbbt.etc.persist_properties.exists?


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rbbt-util-5.14.18 etc/app.d/entities.rb
rbbt-util-5.14.17 etc/app.d/entities.rb
rbbt-util-5.14.16 etc/app.d/entities.rb