Sha256: 6cd077034d1f2828b9f4e123a791a2324548ba02db750b151252f87e91c02e99

Contents?: true

Size: 1.3 KB

Versions: 37

Compression:

Stored size: 1.3 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?
  begin
    mod = Kernel.const_get name
    Log.debug("Including Entity::REST for #{ name }")
    mod.module_eval do
      include Entity::REST
    end
  rescue
    Log.warn "Could extend REST entity: #{ name }"
  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

37 entries across 37 versions & 1 rubygems

Version Path
rbbt-util-5.19.32 etc/app.d/entities.rb
rbbt-util-5.19.31 etc/app.d/entities.rb
rbbt-util-5.19.30 etc/app.d/entities.rb
rbbt-util-5.19.29 etc/app.d/entities.rb
rbbt-util-5.19.28 etc/app.d/entities.rb
rbbt-util-5.19.27 etc/app.d/entities.rb
rbbt-util-5.19.26 etc/app.d/entities.rb
rbbt-util-5.19.25 etc/app.d/entities.rb
rbbt-util-5.19.24 etc/app.d/entities.rb
rbbt-util-5.19.23 etc/app.d/entities.rb
rbbt-util-5.19.22 etc/app.d/entities.rb
rbbt-util-5.19.21 etc/app.d/entities.rb
rbbt-util-5.19.20 etc/app.d/entities.rb
rbbt-util-5.19.19 etc/app.d/entities.rb
rbbt-util-5.19.18 etc/app.d/entities.rb
rbbt-util-5.19.17 etc/app.d/entities.rb
rbbt-util-5.19.16 etc/app.d/entities.rb
rbbt-util-5.19.15 etc/app.d/entities.rb
rbbt-util-5.19.14 etc/app.d/entities.rb
rbbt-util-5.19.13 etc/app.d/entities.rb