Permalink
Browse files

CoffeeLint

  • Loading branch information...
1 parent 9bdb103 commit 214f7d384bc98a2bb365af47d837e35458796689 @bergie committed Oct 2, 2012
Showing with 25 additions and 12 deletions.
  1. +6 −0 .travis.yml
  2. +5 −4 lib/Extension.coffee
  3. +4 −2 lib/configuration.coffee
  4. +2 −1 lib/database.coffee
  5. +6 −4 lib/server.coffee
  6. +2 −1 package.json
View
@@ -0,0 +1,6 @@
+language: node_js
+node_js:
+ - 0.6
+ - 0.8
+
+script: ./node_modules/.bin/coffeelint -r lib
View
@@ -33,7 +33,7 @@ class Extension extends events.EventEmitter
version: "0.0.1"
config: {}
- #
+ #
constructor: (config) ->
###
Set up the extension with a given configuration.
@@ -54,7 +54,7 @@ class Extension extends events.EventEmitter
###
# Get JugglingDB models for Schema
- getModels: (schema) ->
+ getModels: (schema) ->
###
Get the JugglingDB models for a given schema.
@@ -64,7 +64,7 @@ class Extension extends events.EventEmitter
{}
registerRoutes: (server) ->
- ###
+ ###
Register routes to Express server under given prefix
###
@@ -107,5 +107,6 @@ exports.loadExtensions = (config) ->
extension.location = path.resolve config.projectRoot, extension.location
ext = require "#{extension.location}/main"
- loaded[extension.name] = new ext.extension _.defaults extension.configuration, config.extensionDefaults
+ config = _.defaults extension.configuration, config.extensionDefaults
+ loaded[extension.name] = new ext.extension config
loaded
View
@@ -46,7 +46,9 @@ exports.getConfig = (configFile) ->
cfg.projectRoot ?= exports.getProjectRoot configFile
# Heroku support, get server port from environment
- cfg.server?.port = process.env.PORT if process.env.PORT
- cfg.database?.configuration?.url = process.env.DATABASE_URL if process.env.DATABASE_URL
+ if process.env.PORT
+ cfg.server?.port = process.env.PORT
+ if process.env.DATABASE_URL
+ cfg.database?.configuration?.url = process.env.DATABASE_URL
cfg
View
@@ -1,7 +1,8 @@
###
# NodeXT database handling
-This is an optional module of NodeXT that sets up a [JugglingDB](https://github.com/1602/jugglingdb)
+This is an optional module of NodeXT that sets up a
+[JugglingDB](https://github.com/1602/jugglingdb)
database connection based on the given configuration.
###
{Schema} = require 'jugglingdb'
View
@@ -40,8 +40,10 @@ exports.createApplication = (config) ->
models = database.getModels schema, config
if config.server.privateKey and config.server.certificate
- config.server.privateKey = path.resolve config.projectRoot, config.server.privateKey
- config.server.certificate = path.resolve config.projectRoot, config.server.certificate
+ key = path.resolve config.projectRoot, config.server.privateKey
+ cert = path.resolve config.projectRoot, config.server.certificate
+ config.server.privateKey = key
+ config.server.certificate = cert
fs = require 'fs'
serverOptions =
key: fs.readFileSync config.server.privateKey
@@ -59,12 +61,12 @@ exports.createApplication = (config) ->
extension.once 'ready', ->
pending--
do done unless pending
-
+ root = path.resolve config.projectRoot, config.server.view.options.root
if config.server.view
config.server.view.engine ?= 'jade'
config.server.view.options ?= {}
config.server.view.options.root ?= './views'
- config.server.view.options.root = path.resolve config.projectRoot, config.server.view.options.root
+ config.server.view.options.root = root
server.set 'view engine', config.server.view.engine
server.set 'view options', config.server.view.options
server.set 'views', config.server.view.options.root
View
@@ -21,7 +21,8 @@
"devDependencies": {
"coffeedoc": ">=0.1.13",
"async": ">=0.1.18",
- "docco-husky": ">=0.3.2"
+ "docco-husky": ">=0.3.2",
+ "coffeelint": "*"
},
"main": "./lib/nodext",
"bin": {

0 comments on commit 214f7d3

Please sign in to comment.