Permalink
Browse files

[ @ ] Feature: Pieces and contain small full working objects and appl…

…ication can register fully objects
  • Loading branch information...
1 parent 8c0dc8c commit f51f9a22e4a2f0869f15b222fa4f110170a55b45 @pnegri committed Nov 9, 2011
@@ -0,0 +1,13 @@
+arcabouco = require 'arcabouco-js'
+
+config =
+ baseDirectory: __dirname
+
+app = new arcabouco config
+
+app.assemble __dirname + '/pieces'
+
+app.build()
+
+server = app.createServer()
+server.listen 8888
@@ -0,0 +1 @@
+Any JS that should not be assembled should be here
@@ -0,0 +1,6 @@
+!!! 5
+%html
+ %head
+ %title Welcome Page
+ %body
+ %h1 Shake Babbieeeee!!!
@@ -0,0 +1,14 @@
+WelcomeController =
+ index: ( params ) ->
+ responder = params.response
+ template = params.app.Template
+ responder.respondWith template.doRender( 'welcome.index', this, {}, false )
+
+ bootstrap: ( application ) ->
+ return unless application
+ application.Template.loadTemplate __dirname + '/views/index.haml', 'welcome.index'
+
+ getRoutes: ->
+ '/test' : 'index'
+
+module.exports = WelcomeController
View
@@ -91,6 +91,8 @@ class Arcabouco
console.log 'Configuration doesnt have baseDirectory directive'
process.exit(1)
+ global.objects = []
+
@Template.loadTemplate Common.Path.normalize(__dirname + '/../views/404.haml'), '404'
@Template.loadTemplate Common.Path.normalize(__dirname + '/../views/500.haml'), '500'
@@ -179,6 +181,16 @@ class Arcabouco
if valid
@work require file
+ registerObject: ( objectName, object ) ->
+ global.objects[ objectName ] = object
+ true
+
+ buildObject: (objectName) ->
+ new (global.objects[ objectName ])
+
+ getRawObjects: () ->
+ global.objects
+
contructRoutingForPattern : ( pattern ) ->
params = []
buildPattern = pattern.replace /\{(.*?)\}/g,
View
@@ -1,7 +1,7 @@
{
"name" : "arcabouco-js",
"description" : "scalable microframework in node.js",
- "version" : "0.5.9",
+ "version" : "0.6.0",
"author" : "Patrick Negri <patrick@iugu.com.br>",
"homepage": "http://github.com/pnegri/arcabouco-js",
"contributors" : [],

0 comments on commit f51f9a2

Please sign in to comment.