Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Get stuff to work post-install.

  • Loading branch information...
commit 10349a144b639b41fc255b562f2a15956e3593cb 1 parent cb61fff
@mde mde authored
View
21 Jakefile
@@ -1,5 +1,6 @@
+
var fs = require('fs')
- , pkg = JSON.parse(fs.readFileSync('package.json').toString())
+ , pkg = JSON.parse(fs.readFileSync(__dirname + '/package.json').toString())
, version = pkg.version
, child_process = require('child_process')
, exec = child_process.exec;
@@ -111,15 +112,17 @@ var runCmds = function (arr, callback, printStdout) {
};
var t = new jake.PackageTask('geddy', 'v' + version, function () {
+ // Preface with __dirname, will still resolve FileList when
+ // run outside of project dir for generator-tasks
var fileList = [
- 'Makefile'
- , 'Jakefile'
- , 'README.md'
- , 'package.json'
- , 'bin/*'
- , 'deps/*'
- , 'lib/*'
- , 'templates/*'
+ __dirname + '/Makefile'
+ , __dirname + '/Jakefile'
+ , __dirname + '/README.md'
+ , __dirname + '/package.json'
+ , __dirname + '/bin/*'
+ , __dirname + '/deps/*'
+ , __dirname + '/lib/*'
+ , __dirname + '/templates/*'
];
this.packageFiles.include(fileList);
this.needTarGz = true;
View
22 Makefile
@@ -15,24 +15,24 @@
# limitations under the License.
#
-.PHONY: all build install clean uninstall test client
+.PHONY: all build install clean uninstall
all: build
build:
- @mkdir -p ./dist; cp -r geddy-core geddy-auth geddy-model geddy-template geddy-util dist; echo 'Geddy built.'
+ @echo 'Geddy built.'
install:
- @./geddy-core/scripts/jake -f `pwd`/geddy-core/scripts/Jakefile default
+ @mkdir -p /usr/local/lib/node_modules/geddy && \
+ cp -R ./* /usr/local/lib/node_modules/geddy/ && \
+ ln -snf /usr/local/lib/node_modules/geddy/bin/cli.js /usr/local/bin/geddy && \
+ chmod 755 /usr/local/lib/node_modules/geddy/bin/cli.js && \
+ echo 'Geddy installed.'
clean:
- @rm -fr dist
+ @true
uninstall:
- @./geddy-core/scripts/jake -f `pwd`/geddy-core/scripts/Jakefile uninstall
-
-test:
- @./geddy-core/scripts/jake -f `pwd`/geddy-core/scripts/Jakefile test
-
-client:
- @mkdir -p ./dist/client; ./geddy-core/scripts/jake -f `pwd`/geddy-core/scripts/Jakefile client dirname:`pwd` target:`pwd`/dist/client
+ @rm -f /usr/local/bin/geddy && \
+ rm -fr /usr/local/lib/node_modules/geddy/ && \
+ echo 'Geddy uninstalled.'
View
2  bin/cli.js
@@ -104,7 +104,7 @@ if (typeof opts.help != 'undefined') {
else {
// `geddy app foo` or `geddy resource bar` etc. -- run generators
if (cmds.length) {
- cmd = 'jake -f /' + __dirname + '/../Jakefile ';
+ cmd = 'jake -t -f /' + __dirname + '/../Jakefile ';
if (!cmds[1]) {
throw new Error(cmds[0] + ' command requires another argument.');
}
View
16 lib/geddy.js
@@ -45,19 +45,9 @@ geddy.inflection = inflection;
geddy.mixin(geddy, new (function () {
- // Load app-config
- // ==================
- var _loadConfig = function (next) {
- var config = worker.config
- , dirname = '/config'
- , filename = dirname + '/' + config.environment + '.js'
- , appConfig = vm.runInThisContext(fs.readFileSync(dir + filename).toString());
- this.config = geddy.mixin({}, config, appConfig, true);
- next();
- }
// Load controller ctors
// ==================
- , _getControllerConstructors = function (next) {
+ var _getControllerConstructors = function (next) {
var dirname = '/app/controllers'
, dirList = fs.readdirSync(dir + dirname)
, fileName
@@ -167,10 +157,10 @@ geddy.mixin(geddy, new (function () {
// Set up some aliases
this.worker = worker;
this.server = worker.server;
+ this.config = worker.config;
items = [
- _loadConfig
- , _getControllerConstructors
+ _getControllerConstructors
, _loadRouter
, _loadSessionStore
, _registerTemplatePaths
View
2  lib/server.js
@@ -69,7 +69,7 @@ var server = module.exports = new function () {
// How long for a full rotation
, rotationWindow: 2 * 60 * 60 * 1000
// Default logfile location
- , logDir: process.cwd() + '/logs'
+ , logDir: process.cwd() + '/log'
// How long to wait for in-flight requests before killing
, gracefulRestartTimeout: 60000
// Number of milliseconds old a heartbeat-timestamp can be
View
44 templates/base/development.js
@@ -16,39 +16,15 @@
*
*/
-var config = new function () {
- this.detailedErrors = true;
- this.hostname = null;
- this.port = 4000;
- this.sessions = {
+var config = {
+ detailedErrors: true
+, hostname: null
+, port: 4000
+, sessions: {
store: 'memory'
- , key: 'sid'
- , expiry: 14 * 24 * 60 * 60
- };
- /* SQLite
- this.database = {
- adapter: 'sqlite'
- , dbName: 'geddy_db'
- };
- //*/
- /* CouchDB
- this.database = {
- adapter: 'couchdb'
- , hostname: 'localhost'
- , dbName: 'geddy_db'
- , port: 5984
- };
- //*/
- /* PostgreSQL
- this.database = {
- adapter: 'postgresql',
- hostname: 'localhost',
- dbName: 'geddy_db',
- username: 'postgres',
- password: null
- };
- //*/
-
-}();
-config;
+ , key: 'sid'
+ , expiry: 14 * 24 * 60 * 60
+ }
+};
+module.exports = config;
View
44 templates/base/production.js
@@ -16,39 +16,17 @@
*
*/
-var config = new function () {
- this.detailedErrors = false;
- this.hostname = null;
- this.port = 4000;
- this.sessions = {
+var config = {
+ detailedErrors: false
+, hostname: null
+, port: 4000
+, sessions: {
store: 'memory'
- , key: 'sid'
- , expiry: 14 * 24 * 60 * 60
- };
- /*PostgreSQL
- this.database = {
- adapter: 'postgresql'
- , hostname: 'localhost'
- , dbName: 'geddy_db'
- , username: 'postgres'
- , password: null
- };
- //*/
- /* SQLite
- this.database = {
- adapter: 'sqlite'
- , dbName: 'geddy_db'
- };
- //*/
- /* CouchDB
- this.database = {
- adapter: 'couchdb'
- , hostname: 'localhost'
- , dbName: 'geddy_db'
- , port: 5984
- };
- //*/
-}();
-config;
+ , key: 'sid'
+ , expiry: 14 * 24 * 60 * 60
+ }
+};
+
+module.exports = config;
Please sign in to comment.
Something went wrong with that request. Please try again.