Permalink
Browse files

v6.21.8. Bugfix. Improvement.

- v6.21.8 February 5, 2013
	- Swapped out underscore dependency for lodash
	- Underscore is no longer provided to testers
	- `File::getMeta` now alises to `File.getMeta().get` if arguments have
been supplied
	- No longer does deep clones on template data per file render (just
shallow clone now)
	- Fixed a bug that keeps `exists` attribute on `File` always `true`
		- Thanks to [Stefan](https://github.com/stegrams) for [pull request
	- Updated dependencies
		- [bal-util](https://github.com/balupton/bal-util) from ~1.16.3 to
~1.16.3
		- [watchr](https://github.com/bevry/watchr) from ~2.3.3 to ~2.3.4
			- Way better performance and reliability
  • Loading branch information...
balupton committed Feb 5, 2013
1 parent b54f025 commit 0b2ef7a4bc9c18a29d8586bc086202afe8b573a4
View
@@ -1,5 +1,17 @@
## History
- v6.21.8 February 5, 2013
- Swapped out underscore dependency for lodash
- Underscore is no longer provided to testers
- `File::getMeta` now alises to `File.getMeta().get` if arguments have been supplied
- No longer does deep clones on template data per file render (just shallow clone now)
- Fixed a bug that keeps `exists` attribute on `File` always `true`
- Thanks to [Stefan](https://github.com/stegrams) for [pull request #409](https://github.com/bevry/docpad/pull/409)
- Updated dependencies
- [bal-util](https://github.com/balupton/bal-util) from ~1.16.3 to ~1.16.3
- [watchr](https://github.com/bevry/watchr) from ~2.3.3 to ~2.3.4
- Way better performance and reliability
- v6.21.7 January 25, 2013
- Fixed port not defaulting correctly on the `docpad-server` executable since v6.21.5
- Closes [issue #407](https://github.com/bevry/docpad/issues/407) thanks to [man4u](https://github.com/man4u)
View
@@ -1,6 +1,6 @@
{
"name": "docpad",
"version": "6.21.7",
"version": "6.21.8",
"description": "DocPad is a language agnostic document management system. This means you write your website as documents, in whatever language you wish, and DocPad will handle the compiling, templates and layouts for you. For static documents it will generate static files, for dynamic documents it'll re-render them on each request. You can utilise DocPad by itself, or use it as a module your own custom system. It's pretty cool, and well worth checking out. We love it.",
"homepage": "https://github.com/bevry/docpad",
"installUrl": "http://docpad.org/install",
@@ -61,17 +61,17 @@
"npm": ">=1.1"
},
"dependencies": {
"bal-util": "~1.16.1",
"bal-util": "~1.16.3",
"caterpillar": "~1.1.3",
"commander": "~1.1.1",
"cson": "~1.4.0",
"express": "~3.0.6",
"mime": "~1.2.7",
"query-engine": "~1.5.0",
"semver": "~1.1.2",
"underscore": "~1.4.3",
"lodash": "~1.0.0",
"backbone": "0.9.9",
"watchr": "~2.3.3",
"watchr": "~2.3.4",
"yamljs": "~0.1.4"
},
"optionalDependencies": {
View
@@ -1,5 +1,5 @@
# Requires
_ = require('underscore')
balUtil = require('bal-util')
queryEngine = require('query-engine')
Backbone = queryEngine.Backbone
@@ -16,7 +16,7 @@ class Events
log: log
emit: emit
_.extend(Events::, Backbone.Events)
balUtil.extend(Events::, Backbone.Events)
# Model
class Model extends Backbone.Model
@@ -1,5 +1,5 @@
# Necessary
_ = require('underscore')
balUtil = require('bal-util')
# Local
{Collection,Model} = require(__dirname+'/../base')
@@ -14,11 +14,11 @@ class ElementsCollection extends Collection
# Right now we just support strings
add: (values,opts) ->
# Ensure array
values = [values] unless _.isArray(values)
values = [values] unless balUtil.isArray(values)
# Convert string based array properties into html
for value,key in values
if _.isString(value)
if balUtil.isString(value)
values[key] = new Model({html:value})
# Call the super with our values
@@ -1,7 +1,3 @@
# Necessary
_ = require('underscore')
balUtil = require('bal-util')
# Local
{QueryCollection,Model} = require(__dirname+'/../base')
FileModel = require(__dirname+'/../models/file')
@@ -1,5 +1,5 @@
# Necessary
_ = require('underscore')
balUtil = require('bal-util')
# Local
ElementsCollection = require(__dirname+'/elements')
@@ -15,15 +15,15 @@ class ScriptsCollection extends ElementsCollection
opts.defer ?= true
opts.async ?= false
opts.attrs or= ''
values = [values] unless _.isArray(values)
values = [values] unless balUtil.isArray(values)
# Build attrs
opts.attrs += """defer="defer" """ if opts.defer
opts.attrs += """async="async" """ if opts.async
# Convert urls into script element html
for value,key in values
if _.isString(value)
if balUtil.isString(value)
if value[0] is '<'
# we are a script element already, don't bother doing anything
else if value.indexOf(' ') is -1
@@ -1,5 +1,5 @@
# Necessary
_ = require('underscore')
balUtil = require('bal-util')
# Local
ElementsCollection = require(__dirname+'/elements')
@@ -15,11 +15,11 @@ class StylesCollection extends ElementsCollection
opts.attrs or= ''
# Ensure array
values = [values] unless _.isArray(values)
values = [values] unless balUtil.isArray(values)
# Convert urls into script element html
for value,key in values
if _.isString(value) and /^\</.test(value) is false
if balUtil.isString(value) and /^\</.test(value) is false
# convert url to script tag
values[key] = """
<link #{opts.attrs} rel="stylesheet" href="#{value}" />
View
@@ -3,7 +3,7 @@
# Necessary
pathUtil = require('path')
_ = require('underscore')
_ = require('lodash')
caterpillar = require('caterpillar')
CSON = require('cson')
balUtil = require('bal-util')
@@ -496,7 +496,7 @@ class DocPad extends EventEmitterEnhanced
# Add site data
templateData.site.date or= new Date()
templateData.site.keywords or= []
if _.isString(templateData.site.keywords)
if balUtil.isString(templateData.site.keywords)
templateData.site.keywords = templateData.site.keywords.split(/,\s*/g)
# Return
@@ -873,7 +873,7 @@ class DocPad extends EventEmitterEnhanced
# Setup configuration event wrappers
configEventContext = {docpad} # here to allow the config event context to persist between event calls
_.each @getEvents(), (eventName) ->
balUtil.each @getEvents(), (eventName) ->
# Bind to the event
docpad.on eventName, (opts,next) ->
eventHandler = docpad.getConfig().events?[eventName]
@@ -992,9 +992,9 @@ class DocPad extends EventEmitterEnhanced
# Welcome prepare
if @getDebugging()
pluginsList = ("#{pluginName} v#{@loadedPlugins[pluginName].version}" for pluginName in _.keys(@loadedPlugins).sort()).join(', ')
pluginsList = ("#{pluginName} v#{@loadedPlugins[pluginName].version}" for pluginName in Object.keys(@loadedPlugins).sort()).join(', ')
else
pluginsList = _.keys(@loadedPlugins).sort().join(', ')
pluginsList = Object.keys(@loadedPlugins).sort().join(', ')
# Welcome log
@log 'info', util.format(locale.welcome, "v#{@getVersion()}")
@@ -1374,15 +1374,15 @@ class DocPad extends EventEmitterEnhanced
result = {}
# Ensure array
configPaths = [configPaths] unless _.isArray(configPaths)
configPaths = [configPaths] unless balUtil.isArray(configPaths)
# Group
tasks = new balUtil.Group (err) ->
return next(err,result)
# Read our files
# On the first file that returns a result, exit
_.each configPaths, (configPath) ->
balUtil.each configPaths, (configPath) ->
tasks.push (complete) ->
docpad.loadConfigPath configPath, (err,config) ->
return complete(err) if err
@@ -1500,7 +1500,7 @@ class DocPad extends EventEmitterEnhanced
docpad.emitSync('extendCollections',{},next)
# Cycle through Custom Collections
_.each @config.collections, (fn,name) ->
balUtil.each @config.collections, (fn,name) ->
tasks.push (complete) ->
if fn.length is 2 # callback
fn.call docpad, database, (err,collection) ->
@@ -1882,7 +1882,7 @@ class DocPad extends EventEmitterEnhanced
# Check if we have any plugins
hasPlugins: ->
return _.isEmpty(@loadedPlugins) is false
return balUtil.isEmptyObject(@loadedPlugins) is false
# Load Plugins
loadPlugins: (next) ->
@@ -1893,7 +1893,7 @@ class DocPad extends EventEmitterEnhanced
# Snore
@slowPlugins = {}
snore = balUtil.createSnore ->
docpad.log 'notice', util.format(locale.pluginsSlow, _.keys(docpad.slowPlugins).join(', '))
docpad.log 'notice', util.format(locale.pluginsSlow, Object.keys(docpad.slowPlugins).join(', '))
# Async
tasks = new balUtil.Group (err) ->
@@ -1902,14 +1902,14 @@ class DocPad extends EventEmitterEnhanced
return next(err)
# Load website plugins
_.each @config.pluginsPaths or [], (pluginsPath) =>
balUtil.each @config.pluginsPaths or [], (pluginsPath) =>
exists = balUtil.existsSync(pluginsPath)
if exists
tasks.push (complete) =>
@loadPluginsIn(pluginsPath, complete)
# Load specific plugins
_.each @config.pluginPaths or [], (pluginPath) =>
balUtil.each @config.pluginPaths or [], (pluginPath) =>
exists = balUtil.existsSync(pluginPath)
if exists
tasks.push (complete) =>
@@ -2096,7 +2096,7 @@ class DocPad extends EventEmitterEnhanced
# next(err,exchange)
getExchange: (next) ->
# Check if it is stored locally
return next(null,@exchange) unless _.isEmpty(@exchange)
return next(null,@exchange) unless balUtil.isEmptyObject(@exchange)
# Otherwise fetch it from the exchangeUrl
@loadConfigUrl @config.exchangeUrl, (err,parsedData) ->
@@ -2392,7 +2392,7 @@ class DocPad extends EventEmitterEnhanced
if actions.length > 1
tasks = new balUtil.Group (err) ->
return next(err)
_.each actions, (action) -> tasks.push (complete) ->
balUtil.each actions, (action) -> tasks.push (complete) ->
docpad.action(action,opts,complete)
tasks.sync()
return docpad
@@ -2520,21 +2520,21 @@ class DocPad extends EventEmitterEnhanced
return next(err)
# Documents
_.each config.documentsPaths, (documentsPath) -> tasks.push (complete) ->
balUtil.each config.documentsPaths, (documentsPath) -> tasks.push (complete) ->
docpad.parseDocumentDirectory({
path: documentsPath
collection: database
},complete)
# Files
_.each config.filesPaths, (filesPath) -> tasks.push (complete) ->
balUtil.each config.filesPaths, (filesPath) -> tasks.push (complete) ->
docpad.parseFileDirectory({
path: filesPath
collection: database
},complete)
# Layouts
_.each config.layoutsPaths, (layoutsPath) -> tasks.push (complete) ->
balUtil.each config.layoutsPaths, (layoutsPath) -> tasks.push (complete) ->
docpad.parseDocumentDirectory({
path: layoutsPath
collection: database
@@ -1,7 +1,6 @@
# Necessary
pathUtil = require('path')
balUtil = require('bal-util')
_ = require('underscore')
mime = require('mime')
# Optional
@@ -508,7 +507,7 @@ class DocumentModel extends FileModel
# Merge in the layout meta data into the document JSON
# and make the result available via documentMerged
# templateData.document.metaMerged = _.extend({}, layout.getMeta().toJSON(), file.getMeta().toJSON())
# templateData.document.metaMerged = balUtil.extend({}, layout.getMeta().toJSON(), file.getMeta().toJSON())
# Render the layout with the templateData
layout.render {templateData}, (err,result) ->
@@ -530,14 +529,14 @@ class DocumentModel extends FileModel
# Prepare options
{opts,next} = @getActionArgs(opts,next)
opts = _.clone(opts or {})
opts = balUtil.clone(opts or {})
opts.actions ?= ['renderExtensions','renderDocument','renderLayouts']
# Prepare content
opts.content ?= @get('body')
# Prepare templateData
opts.templateData = _.clone(opts.templateData or {})
opts.templateData = balUtil.clone(opts.templateData or {}) # deepClone may be more suitable
opts.templateData.document ?= file.toJSON()
opts.templateData.documentModel ?= file
@@ -196,9 +196,12 @@ class FileModel extends Model
return @toJSON()
# Get Meta
getMeta: ->
getMeta: (args...) ->
@meta = new Model() if @meta is null
return @meta
if args.length
return @meta.get(args...)
else
return @meta
# Set Meta
setMeta: (attrs) ->
View
@@ -1,6 +1,5 @@
# Requires
pathUtil = require('path')
_ = underscore = require('underscore')
balUtil = require('bal-util')
joe = require('joe')
chai = require('chai')
@@ -13,7 +12,6 @@ DocPad = require(__dirname+'/docpad')
# Prepare
pluginPort = 2000+process.pid
testers = {
underscore,
balUtil,
chai,
expect,
@@ -5,7 +5,7 @@ DocPad = require(__dirname+'/../lib/docpad')
chai = require('chai')
expect = chai.expect
joe = require('joe')
_ = require('underscore')
_ = require('lodash')
# -------------------------------------
# Configuration
@@ -100,7 +100,7 @@ joe.suite 'docpad-actions', (suite,test) ->
ignoreHiddenFiles: false
next: (err,outExpectedList) ->
# check we have the same files
expect(_.difference(_.keys(outList),_.keys(outExpectedList))).to.be.empty
expect(_.difference(Object.keys(outList),Object.keys(outExpectedList))).to.be.empty
# check the contents of those files match
for own key,actual of outList
expected = outExpectedList[key]
View
@@ -3,7 +3,6 @@ balUtil = require('bal-util')
chai = require('chai')
expect = chai.expect
joe = require('joe')
_ = require('underscore')
# -------------------------------------
# Configuration
@@ -3,7 +3,6 @@ balUtil = require('bal-util')
chai = require('chai')
expect = chai.expect
joe = require('joe')
_ = require('underscore')
pathUtil = require('path')
# -------------------------------------

0 comments on commit 0b2ef7a

Please sign in to comment.