Sha256: 61c7c472095b1c6b7f2e9ea7320c698ca5f09f478d0f5bdbfc4db9bcfd837937

Contents?: true

Size: 1.13 KB

Versions: 14

Compression:

Stored size: 1.13 KB

Contents

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 not 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

14 entries across 14 versions & 1 rubygems

Version Path
rbbt-util-5.21.76 etc/app.d/entities.rb
rbbt-util-5.21.75 etc/app.d/entities.rb
rbbt-util-5.21.74 etc/app.d/entities.rb
rbbt-util-5.21.73 etc/app.d/entities.rb
rbbt-util-5.21.72 etc/app.d/entities.rb
rbbt-util-5.21.71 etc/app.d/entities.rb
rbbt-util-5.21.70 etc/app.d/entities.rb
rbbt-util-5.21.69 etc/app.d/entities.rb
rbbt-util-5.21.68 etc/app.d/entities.rb
rbbt-util-5.21.67 etc/app.d/entities.rb
rbbt-util-5.21.66 etc/app.d/entities.rb
rbbt-util-5.21.64 etc/app.d/entities.rb
rbbt-util-5.21.63 etc/app.d/entities.rb
rbbt-util-5.21.62 etc/app.d/entities.rb