@leansdk/leanrc
Version:
LeanRC is a MVC framework for creating graceful applications
63 lines (52 loc) • 1.78 kB
text/coffeescript
module.exports = (Module) ->
{
CONFIGURATION
RESQUE
APPLICATION_RENDERER
APPLICATION_ROUTER
MIGRATIONS
ApplicationSerializer
HttpSerializer
SimpleCommand
MainConfiguration
MainResque
MigrationsCollection
MainCollection
ApplicationGateway
BaseMigration
ThinHttpCollection
TomatoRecord
CucumberRecord
Renderer
ApplicationRouter
} = Module::
class PrepareModelCommand extends SimpleCommand
Module
execute: Function,
default: (aoNotification)->
voApplication = aoNotification.getBody()
.registerProxy MainConfiguration.new CONFIGURATION, ::ROOT
.registerProxy MainResque.new RESQUE
.registerProxy MigrationsCollection.new MIGRATIONS,
delegate: BaseMigration
serializer: ApplicationSerializer
.registerProxy MainCollection.new 'TomatosCollection',
delegate: TomatoRecord
serializer: ApplicationSerializer
.registerProxy ThinHttpCollection.new 'CucumbersCollection',
delegate: CucumberRecord
serializer: HttpSerializer
.registerProxy ApplicationRouter.new APPLICATION_ROUTER
unless voApplication.isLightweight
.registerProxy Renderer.new APPLICATION_RENDERER
.registerProxy ApplicationGateway.new 'TomatosGateway',
entityName: 'tomato'
schema: TomatoRecord.schema
.registerProxy ApplicationGateway.new 'ItselfGateway',
entityName: 'info'
schema: {}
endpoints: {
info: Module::ItselfInfoEndpoint
}
PrepareModelCommand.initialize()