/*1* flatiron.js: An elegant blend of convention and configuration for building apps in Node.js and the browser.2*3* Copyright(c) 2011 Nodejitsu Inc. <[email protected]>4* MIT LICENCE5*6*/78var fs = require('fs'),9path = require('path'),10broadway = require('broadway');1112var flatiron = exports,13_app;1415//16// Expose version through `pkginfo`17//18require('pkginfo')(module, 'version');1920//21// ### Export core `flatiron` modules22//23flatiron.common = require('./flatiron/common');24flatiron.constants = require('./flatiron/constants');25flatiron.formats = broadway.formats;26flatiron.App = require('./flatiron/app').App;2728//29// ### Expose core `flatiron` plugins30// Hoist those up from `broadway` and define each of31// the `flatiron` plugins as a lazy loaded `require` statement32//33flatiron.plugins = broadway.common.mixin(34{},35broadway.plugins,36broadway.common.requireDirLazy(path.join(__dirname, 'flatiron', 'plugins'))37);3839//40// ### getter @app {flatiron.App}41// Gets the default top-level Application for `flatiron`42//43flatiron.__defineGetter__('app', function () {44if (!_app) {45_app = new flatiron.App();46}4748return _app;49});5051//52// ### setter @app {flatiron.App}53// Sets the default top-level Application for `flatiron`54//55flatiron.__defineSetter__('app', function (value) {56_app = value;57});5859//60// ### function createApp (options)61// #### @options {Object} Options for the application to create62// Creates a new instance of `flatiron.App` with the63// specified `options`.64//65flatiron.createApp = function (options) {66return new flatiron.App(options);67};68697071