class Manifest
cattr_accessor :manifest
attr :system_resources, :magic_numbers,
- :controllers, :models,
- :list_groups, :profilers, :filers, :forms
+ :controllers, :models
# call me before load routes.rb
# routes.rb needs engine_resources manifest in system_resources
# ex. it's adding license_groups routes
- def initialize manifest
- @manifest = manifest || {}
- @system_resources = SystemResource.new(self, SystemResource.set_default(@manifest['system_resources']))
- @magic_numbers = @manifest['magic_numbers']
+ def initialize global_json
+ @global_json = global_json || {}
+ @system_resources = SystemResource.new(self, SystemResource.set_default(@global_json['system_resources']))
+ @magic_numbers = @global_json['magic_numbers']
end
def init
# managers can't initialize before load application.rb
return unless defined? ::Pettanr
- @controllers = Controller.manager(self, @manifest['controllers'] || {})
- @models = Model.manager(self, @manifest['models'] || {})
- @locals = @manifest['locals']
- @list_groups = ListGroup.manager(self, @locals['list_groups'] || {})
- @filers = Filer.manager(self, @locals['filers'] || {})
- @profilers = Profiler.manager(self, @locals['profilers'] || {})
- @forms = Form.base_manager(self, @locals['forms'] || {})
- @forms.merge(Form.extend_manager(self, @locals['forms'] || {}))
+ @controllers = Controller.manager(self, @global_json['controllers'] || {})
+ @models = Model.manager(self, @global_json['models'] || {})
+ end
+
+ def system_resources_init
@system_resources.init
end
Manifest.manifest
end
- def load json
- Manifest.manifest = Manifest.new json
+ def load global_json
+ Manifest.manifest = Manifest.new global_json
end
def item_name_to_model item_name