Skip to content

Commit

Permalink
Working with latest importer code - docpad/docpad#500
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Jul 18, 2013
1 parent f441bca commit f2ca1d9
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 90 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -15,7 +15,4 @@ node_modules
npm-debug.log

test/out/
test/render-out/
test/src/documents/tumblr/
test/.env
out/
4 changes: 4 additions & 0 deletions .npmignore
@@ -1,6 +1,10 @@
.travis*
Makefile
Cakefile
History.md

src/
out/*.tester.*
out/*.test.*
out/test/
test/
22 changes: 22 additions & 0 deletions .travis.yml
@@ -0,0 +1,22 @@
# v1.1.1 June 25, 2013
# This file was originally created by Benjamin Lupton <b@lupton.cc> (http://balupton.com)
# and is currently licensed under the Creative Commons Zero (http://creativecommons.org/publicdomain/zero/1.0/)
# making it public domain so you can do whatever you wish with it without worry (you can even remove this notice!)
#
# If you change something here, be sure to reflect the changes in:
# - the Cakefile
# - the scripts section of the package.json file
# - the .travis.yml file
language: node_js
before_script: "./node_modules/.bin/cake test-setup"
script: "npm test"
node_js:
- "0.8"
- "0.10"
notifications:
irc:
- "irc.freenode.org#bevry-dev"
- "irc.freenode.org#docpad-dev"
email:
recipients:
- travisci@bevry.me
91 changes: 61 additions & 30 deletions Cakefile
@@ -1,26 +1,31 @@
# v1.1.1 June 25, 2013
# This file was originally created by Benjamin Lupton <b@lupton.cc> (http://balupton.com)
# and is currently licensed under the Creative Commons Zero (http://creativecommons.org/publicdomain/zero/1.0/)
# making it public domain so you can do whatever you wish with it without worry (you can even remove this notice!)
#
# If you change something here, be sure to reflect the changes in:
# - the Cakefile
# - the scripts section of the package.json file
# - the .travis.yml file


# -----------------
# Variables

WINDOWS = process.platform.indexOf('win') is 0
NODE = process.execPath
NPM = if WINDOWS then process.execPath.replace('node.exe','npm.cmd') else 'npm'
EXT = (if WINDOWS then '.cmd' else '')
APP = process.cwd()
BIN = "#{APP}/node_modules/.bin"
CAKE = "#{BIN}/cake#{EXT}"
COFFEE = "#{BIN}/coffee#{EXT}"
OUT = "#{APP}/out"
SRC = "#{APP}/src"
TEST = "#{APP}/test"
WINDOWS = process.platform.indexOf('win') is 0
NODE = process.execPath
NPM = if WINDOWS then process.execPath.replace('node.exe','npm.cmd') else 'npm'
EXT = (if WINDOWS then '.cmd' else '')
APP_DIR = process.cwd()
SRC_DIR = "#{APP_DIR}/src"
OUT_DIR = "#{APP_DIR}/out"
TEST_DIR = "#{APP_DIR}/test"
MODULES_DIR = "#{APP_DIR}/node_modules"
BIN_DIR = "#{MODULES_DIR}/.bin"
DOCPAD_DIR = "#{MODULES_DIR}/docpad"
CAKE = "#{BIN_DIR}/cake#{EXT}"
COFFEE = "#{BIN_DIR}/coffee#{EXT}"
DOCPAD = "#{APP_DIR}/docpad#{EXT}"


# -----------------
Expand All @@ -41,41 +46,68 @@ clean = (opts,next) ->
(next = opts; opts = {}) unless next?
args = [
'-Rf'
OUT
pathUtil.join(APP,'node_modules')
pathUtil.join(APP,'*out')
pathUtil.join(APP,'*log')
pathUtil.join(TEST,'node_modules')
pathUtil.join(TEST,'*out')
pathUtil.join(TEST,'*log')
OUT_DIR
pathUtil.join(APP_DIR, 'node_modules')
pathUtil.join(APP_DIR, '*out')
pathUtil.join(APP_DIR, '*log')
pathUtil.join(TEST_DIR, 'node_modules')
pathUtil.join(TEST_DIR, '*out')
pathUtil.join(TEST_DIR, '*log')
]
spawn('rm', args, {stdio:'inherit',cwd:APP}).on('exit',next)
spawn('rm', args, {stdio:'inherit', cwd:APP_DIR}).on 'exit', safe next, ->
next()

compile = (opts,next) ->
(next = opts; opts = {}) unless next?
spawn(COFFEE, ['-bco', OUT, SRC], {stdio:'inherit',cwd:APP}).on('exit',next)
spawn(COFFEE, ['-bco', OUT_DIR, SRC_DIR], {stdio:'inherit', cwd:APP_DIR}).on 'exit', safe next, ->
next()

watch = (opts,next) ->
(next = opts; opts = {}) unless next?
spawn(COFFEE, ['-bwco', OUT, SRC], {stdio:'inherit',cwd:APP}).on('exit',next)
spawn(COFFEE, ['-bwco', OUT_DIR, SRC_DIR], {stdio:'inherit', cwd:APP_DIR}).on 'exit', safe next, ->
next()

install = (opts,next) ->
(next = opts; opts = {}) unless next?
spawn(NPM, ['install'], {stdio:'inherit',cwd:APP}).on 'exit', safe next, ->
spawn(NPM, ['install'], {stdio:'inherit',cwd:TEST}).on('exit',next)
spawn(NPM, ['install'], {stdio:'inherit', cwd:APP_DIR}).on 'exit', safe next, ->
spawn(NPM, ['install'], {stdio:'inherit', cwd:TEST_DIR}).on 'exit', safe next, ->
next()

reset = (opts,next) ->
(next = opts; opts = {}) unless next?
clean opts, safe next, -> install opts, safe next, -> compile opts, next
clean opts, safe next, ->
install opts, safe next, ->
compile opts, safe next, ->
next()

setup = (opts,next) ->
(next = opts; opts = {}) unless next?
install opts, safe next, ->
compile opts, next
compile opts, safe next, ->
next()

test = (opts,next) ->
(next = opts; opts = {}) unless next?
spawn(NPM, ['test'], {stdio:'inherit',cwd:APP}).on('exit',next)
compile opts, safe next, ->
test_run opts, safe next, ->
next()

test_run = (opts,next) ->
(next = opts; opts = {}) unless next?
spawn(NPM, ['test'], {stdio:'inherit', cwd:APP_DIR}).on 'exit', safe next, ->
next()

test_install = (opts,next) ->
(next = opts; opts = {}) unless next?
spawn(NPM, ['install'], {stdio:'inherit', cwd:DOCPAD_DIR}).on 'exit', safe next, ->
next()

test_setup = (opts,next) ->
(next = opts; opts = {}) unless next?
install opts, safe next, ->
test_install opts, safe next, ->
compile opts, safe next, ->
next()

finish = (err) ->
throw err if err
Expand Down Expand Up @@ -119,7 +151,6 @@ task 'test', 'run our tests', ->
task 'test-debug', 'run our tests in debug mode', ->
test {debug:true}, finish

# test-prepare
task 'test-prepare', 'prepare out tests', ->
setup finish

# test-setup
task 'test-setup', 'setup for testing', ->
test_setup finish
36 changes: 36 additions & 0 deletions Contributing.md
@@ -0,0 +1,36 @@
# Contributing

## Support

[Post your question on StackOverflow with the `docpad` tag](http://stackoverflow.com/questions/tagged/docpad)


## Bug reports

[Post your bug report on the GitHub Issue Tracker for this project](https://github.com/docpad/docpad-plugin-tumblr/issues)


## Development

### Install dependencies

``` bash
npm install; npm install -g coffee-script
```

### Setup for development

``` bash
cake setup
```

### Watch and compile

``` bash
cake watch
```


## Testing

No tests yet!
9 changes: 9 additions & 0 deletions LICENSE.md
@@ -0,0 +1,9 @@
# The MIT License

Copyright &copy; 2013+ [Bevry Pty Ltd](http://bevry.me) <us@bevry.me>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 changes: 19 additions & 4 deletions README.md
@@ -1,13 +1,28 @@
# Tumblr Importer Plugin for [DocPad](http://docpad.org)
# [Tumblr](https://www.tumblr.com/) Importer Plugin for [DocPad](http://docpad.org)

Under construction.
[![Build Status](https://secure.travis-ci.org/bevry/docpad-plugin-tumblr.png?branch=master)](http://travis-ci.org/bevry/docpad-plugin-tumblr "Check this project's build status on TravisCI")
[![NPM version](https://badge.fury.io/js/docpad-plugin-tumblr.png)](https://npmjs.org/package/docpad-plugin-tumblr "View this project on NPM")
[![Gittip donate button](http://badgr.co/gittip/docpad.png)](https://www.gittip.com/docpad/ "Donate weekly to this project using Gittip")
[![Flattr donate button](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr")
[![PayPayl donate button](https://www.paypalobjects.com/en_AU/i/btn/btn_donate_SM.gif)](https://www.paypal.com/au/cgi-bin/webscr?cmd=_flow&SESSION=IHj3DG3oy_N9A9ZDIUnPksOi59v0i-EWDTunfmDrmU38Tuohg_xQTx0xcjq&dispatch=5885d80a13c0db1f8e263663d3faee8d14f86393d55a810282b64afed84968ec "Donate once-off to this project using Paypal")

Import your Tumblr content directly into your DocPad database


## Install

```
docpad install tumblr
```

## History
You can discover the history inside the `History.md` file
[You can discover the history inside the `History.md` file](https://github.com/bevry/docpad-plugin-tumblr/blob/master/History.md#files)


## Contributing
[You can discover the contributing instructions inside the `Contributing.md` file](https://github.com/bevry/docpad-plugin-tumblr/blob/master/Contributing.md#files)


## License
Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)
<br/>Copyright &copy; 2013 [Bevry Pty Ltd](http://bevry.me)
<br/>Copyright &copy; 2013+ [Bevry Pty Ltd](http://bevry.me) <us@bevry.me>
10 changes: 6 additions & 4 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "docpad-plugin-tumblr",
"version": "2.0.0",
"description": "Imports tumblr posts into the DocPad Database",
"description": "Import your Tumblr content directly into your DocPad database",
"homepage": "http://docpad.org/plugin/tumblr",
"keywords": [
"docpad",
Expand All @@ -27,11 +27,13 @@
"docpad": ">=6.21 <7"
},
"dependencies": {
"bal-util": "~1.16.13",
"feedr": "~2.4.0"
"eachr": "~2.0.2",
"taskgroup": "~3.1.2",
"feedr": "~2.5.0"
},
"devDependencies": {
"coffee-script": "~1.6.2"
"coffee-script": "~1.6.2",
"docpad": ">=6.37 <7"
},
"main": "./out/tumblr.plugin.js",
"scripts": {
Expand Down

0 comments on commit f2ca1d9

Please sign in to comment.