Skip to content

Commit

Permalink
v6.59.0. Bugfix.
Browse files Browse the repository at this point in the history
- v6.59.0 December 19, 2013
	- Removed the previously deprecated `ensureFile`, `ensureDocument`, `ensureModel`/`ensureFileOrDocument` methods, use `addFile`, `addDocument`, and `addModel` instead
	- Improved watching, should hopefully fix [#738](#738), [#742](#742), [#739](#739)
	- Updated dependencies
  • Loading branch information
balupton committed Dec 19, 2013
1 parent df173cf commit 165edfe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 29 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# History

- v6.59.0 December 19, 2013
- Removed the previously deprecated `ensureFile`, `ensureDocument`, `ensureModel`/`ensureFileOrDocument` methods, use `addFile`, `addDocument`, and `addModel` instead
- Improved watching, should hopefully fix [#738](https://github.com/bevry/docpad/issues/738), [#742](https://github.com/bevry/docpad/issues/742), [#739](https://github.com/bevry/docpad/issues/739)
- Updated dependencies

- v6.58.2 December 18, 2013
- Can now change the hostname that we listen to via the `hostname` configuration option
- Thanks to [Dario](https://github.com/radiodario) for [pull request #737](https://github.com/bevry/docpad/pull/737)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "DocPad. Streamlined web development.",
"name": "docpad",
"version": "6.58.2",
"version": "6.59.0",
"description": "DocPad is a next generation web architecture that lets you create fast static websites with dynamic abilities and powerful abstractions. Write your website as files on your computer, entries in a database, or even RSS feeds and DocPad will import it, generate & render it, then output a static website for deployment anywhere or a dynamic node website for advanced server-side functionality. Use it as a module or standalone. It's purely awesome. Check it out.",
"homepage": "http://docpad.org",
"installUrl": "http://docpad.org/install",
Expand Down Expand Up @@ -128,13 +128,13 @@
"mime": "~1.2.9",
"progressbar": "~1.0.3",
"query-engine": "~1.5.5",
"safefs": "~3.0.6",
"safefs": "~3.1.0",
"safeps": "~2.2.9",
"semver": "~2.2.1",
"superagent": "~0.15.4",
"taskgroup": "~3.3.6",
"typechecker": "~2.0.8",
"watchr": "~2.4.6",
"watchr": "~2.4.7",
"yamljs": "~0.1.4",
"promptly": "~0.2.0",
"istextorbinary": "~1.0.0"
Expand Down
30 changes: 4 additions & 26 deletions src/lib/docpad.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2396,33 +2396,15 @@ class DocPad extends EventEmitterGrouped
# b/c compat functions

# Create File
# Here for b/c compat
createFile: (attrs={},opts={}) ->
opts.modelType = 'file'
return @createModel(attrs, opts)

# Create Document
# Here for b/c compat
createDocument: (attrs={},opts={}) ->
opts.modelType = 'document'
return @createModel(attrs, opts)

# Ensure File
# Here for b/c compat
ensureFile: (attrs={},opts={}) ->
opts.modelType = 'file'
return @ensureModel(attrs, opts)

# Ensure Document
# Here for b/c compat
ensureDocument: (attrs={},opts={}) ->
opts.modelType = 'document'
return @ensureModel(attrs, opts)

# Ensure File or Document
# Here for b/c compat
ensureFileOrDocument: (args...) -> @ensureModel(args...)

# Parse File Directory
parseFileDirectory: (opts={},next) ->
opts.modelType ?= 'file'
Expand Down Expand Up @@ -2487,10 +2469,6 @@ class DocPad extends EventEmitterGrouped
# Return
return clone

# Ensure Model
# Here for b/c compat
ensureModel: (args...) -> @createModel(args...)

# Add Model
addModel: (model, opts) ->
model = @createModel(model, opts)
Expand Down Expand Up @@ -2523,7 +2501,7 @@ class DocPad extends EventEmitterGrouped


# Find or create
# This functioanlity use to be inside ensureModel
# This functionality use to be inside ensureModel
# But that caused duplicates in some instances
# So now we will always check
if attrs.fullPath
Expand Down Expand Up @@ -3690,7 +3668,7 @@ class DocPad extends EventEmitterGrouped
},opts.attributes)

# Handle
document = @ensureDocument(attributes)
document = @createDocument(attributes)
@loadAndRenderDocument(document, opts, next)

# Chain
Expand Down Expand Up @@ -3880,7 +3858,7 @@ class DocPad extends EventEmitterGrouped

performGenerate = (opts={}) ->
# Q: Should we also pass over the collection?
# A: No, doing the mtime thing in generatePrepare is more robust
# A: No, doing the mtime query in generate is more robust

# Log
docpad.log util.format(locale.watchRegenerating, new Date().toLocaleTimeString())
Expand Down Expand Up @@ -3914,7 +3892,7 @@ class DocPad extends EventEmitterGrouped
fileCurrentStat?.mtime = new Date()

# Create the file object
file = docpad.ensureModel({fullPath:filePath}, {stat:fileCurrentStat}) # adds to database if not existant
file = docpad.addModel({fullPath:filePath, stat:fileCurrentStat})
file.setStat(fileCurrentStat) if changeType is 'update'

# File was deleted, delete the rendered file, and remove it from the database
Expand Down

0 comments on commit 165edfe

Please sign in to comment.