Fixing broken links
This commit is contained in:
parent
b4c88ee03d
commit
c1b48de841
7
build.js
7
build.js
|
@ -26,6 +26,7 @@ var rootpath = require('metalsmith-rootpath');
|
|||
var collections = require('metalsmith-collections');
|
||||
var filenamedate = require('metalsmith-date-in-filename');
|
||||
var registerHelpers = require('metalsmith-register-helpers');
|
||||
var asset = require('metalsmith-static');
|
||||
var match = require('multimatch');
|
||||
|
||||
/**
|
||||
|
@ -138,9 +139,13 @@ var metalsmith = Metalsmith(__dirname)
|
|||
partials: "partials"
|
||||
}))
|
||||
)
|
||||
.use(asset({
|
||||
src: 'static',
|
||||
dst: '.'
|
||||
}))
|
||||
// Validate
|
||||
.use(linkchecker({
|
||||
allowRegex: /^(\/resources|\/slides)/,
|
||||
allowRegex: /^(\/resources|\/slides|\/software)/,
|
||||
allowRedirect: true
|
||||
}))
|
||||
// Compress
|
||||
|
|
15
node_modules/metalsmith-static/.npmignore
generated
vendored
Normal file
15
node_modules/metalsmith-static/.npmignore
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
lib-cov
|
||||
*.seed
|
||||
*.log
|
||||
*.csv
|
||||
*.dat
|
||||
*.out
|
||||
*.pid
|
||||
*.gz
|
||||
pids
|
||||
logs
|
||||
results
|
||||
npm-debug.log
|
||||
node_modules
|
||||
*.swp
|
||||
*.swp
|
21
node_modules/metalsmith-static/LICENSE
generated
vendored
Normal file
21
node_modules/metalsmith-static/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Daniel
|
||||
|
||||
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.
|
61
node_modules/metalsmith-static/README.md
generated
vendored
Normal file
61
node_modules/metalsmith-static/README.md
generated
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
# MetalSmith Static
|
||||
|
||||
Provides a simple plugin to copy assets from /public (configurable) to the build directory.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm install metalsmith-static
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
```js
|
||||
var asset = require('metalsmith-static');
|
||||
var Metalsmith = require('metalsmith');
|
||||
|
||||
var metalsmith = Metalsmith('test/fixtures/one');
|
||||
metalsmith
|
||||
.use(asset())
|
||||
.build(function(err) {
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## Using the CLI
|
||||
|
||||
The source and destination directores can be configured using the `src` and `dest` options.
|
||||
|
||||
```javascript
|
||||
{
|
||||
"metalsmith-static": {
|
||||
"src": "public",
|
||||
"dest": "."
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Daniel Fagnan
|
||||
|
||||
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.
|
0
node_modules/metalsmith-static/build/styles.css
generated
vendored
Normal file
0
node_modules/metalsmith-static/build/styles.css
generated
vendored
Normal file
42
node_modules/metalsmith-static/lib/index.js
generated
vendored
Normal file
42
node_modules/metalsmith-static/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* Module Dependencies.
|
||||
*/
|
||||
|
||||
var debug = require('debug')('metalsmith-static');
|
||||
var ncp = require('ncp').ncp;
|
||||
var path = require('path');
|
||||
var fsextra = require('fs-extra');
|
||||
|
||||
|
||||
/**
|
||||
* Module Exports
|
||||
*/
|
||||
|
||||
module.exports = function(assets) {
|
||||
assets = assets || [{}];
|
||||
assets = !Array.isArray(assets) ? [ assets ] : assets;
|
||||
|
||||
return function(files, metalsmith, done) {
|
||||
assets.forEach(function(opts) {
|
||||
var relSrc = opts.src || 'public';
|
||||
var relDest = opts.dest || 'public';
|
||||
var createDest = opts.createDest || true;
|
||||
|
||||
var src = path.join(metalsmith.directory(), relSrc);
|
||||
var dst = path.join(metalsmith.destination(), relDest);
|
||||
|
||||
if (createDest) {
|
||||
var dir = path.dirname(dst);
|
||||
|
||||
debug('creating: %s', dir);
|
||||
fsextra.mkdirpSync(dir);
|
||||
}
|
||||
|
||||
ncp(src, dst, function(err) {
|
||||
if (err) return done(err);
|
||||
});
|
||||
});
|
||||
|
||||
done();
|
||||
};
|
||||
};
|
1
node_modules/metalsmith-static/node_modules/.bin/ncp
generated
vendored
Symbolic link
1
node_modules/metalsmith-static/node_modules/.bin/ncp
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
../ncp/bin/ncp
|
4
node_modules/metalsmith-static/node_modules/ncp/.npmignore
generated
vendored
Normal file
4
node_modules/metalsmith-static/node_modules/ncp/.npmignore
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
node_modules
|
||||
.*.sw[op]
|
||||
.DS_Store
|
||||
test/fixtures/out
|
6
node_modules/metalsmith-static/node_modules/ncp/.travis.yml
generated
vendored
Normal file
6
node_modules/metalsmith-static/node_modules/ncp/.travis.yml
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
language: node_js
|
||||
|
||||
node_js:
|
||||
- 0.8
|
||||
- "0.10"
|
||||
- "0.11"
|
21
node_modules/metalsmith-static/node_modules/ncp/LICENSE.md
generated
vendored
Normal file
21
node_modules/metalsmith-static/node_modules/ncp/LICENSE.md
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
# MIT License
|
||||
|
||||
###Copyright (C) 2011 by Charlie McConnell
|
||||
|
||||
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.
|
58
node_modules/metalsmith-static/node_modules/ncp/README.md
generated
vendored
Normal file
58
node_modules/metalsmith-static/node_modules/ncp/README.md
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
# ncp - Asynchronous recursive file & directory copying
|
||||
|
||||
[![Build Status](https://secure.travis-ci.org/AvianFlu/ncp.png)](http://travis-ci.org/AvianFlu/ncp)
|
||||
|
||||
Think `cp -r`, but pure node, and asynchronous. `ncp` can be used both as a CLI tool and programmatically.
|
||||
|
||||
## Command Line usage
|
||||
|
||||
Usage is simple: `ncp [source] [dest] [--limit=concurrency limit]
|
||||
[--filter=filter] --stopOnErr`
|
||||
|
||||
The 'filter' is a Regular Expression - matched files will be copied.
|
||||
|
||||
The 'concurrency limit' is an integer that represents how many pending file system requests `ncp` has at a time.
|
||||
|
||||
'stoponerr' is a boolean flag that will tell `ncp` to stop immediately if any
|
||||
errors arise, rather than attempting to continue while logging errors. The default behavior is to complete as many copies as possible, logging errors along the way.
|
||||
|
||||
If there are no errors, `ncp` will output `done.` when complete. If there are errors, the error messages will be logged to `stdout` and to `./ncp-debug.log`, and the copy operation will attempt to continue.
|
||||
|
||||
## Programmatic usage
|
||||
|
||||
Programmatic usage of `ncp` is just as simple. The only argument to the completion callback is a possible error.
|
||||
|
||||
```javascript
|
||||
var ncp = require('ncp').ncp;
|
||||
|
||||
ncp.limit = 16;
|
||||
|
||||
ncp(source, destination, function (err) {
|
||||
if (err) {
|
||||
return console.error(err);
|
||||
}
|
||||
console.log('done!');
|
||||
});
|
||||
```
|
||||
|
||||
You can also call ncp like `ncp(source, destination, options, callback)`.
|
||||
`options` should be a dictionary. Currently, such options are available:
|
||||
|
||||
* `options.filter` - a `RegExp` instance, against which each file name is
|
||||
tested to determine whether to copy it or not, or a function taking single
|
||||
parameter: copied file name, returning `true` or `false`, determining
|
||||
whether to copy file or not.
|
||||
|
||||
* `options.transform` - a function: `function (read, write) { read.pipe(write) }`
|
||||
used to apply streaming transforms while copying.
|
||||
|
||||
* `options.clobber` - boolean=true. if set to false, `ncp` will not overwrite
|
||||
destination files that already exist.
|
||||
|
||||
* `options.stopOnErr` - boolean=false. If set to true, `ncp` will behave like `cp -r`,
|
||||
and stop on the first error it encounters. By default, `ncp` continues copying, logging all
|
||||
errors and returning an array.
|
||||
|
||||
* `options.errs` - stream. If `options.stopOnErr` is `false`, a stream can be provided, and errors will be written to this stream.
|
||||
|
||||
Please open an issue if any bugs arise. As always, I accept (working) pull requests, and refunds are available at `/dev/null`.
|
48
node_modules/metalsmith-static/node_modules/ncp/bin/ncp
generated
vendored
Executable file
48
node_modules/metalsmith-static/node_modules/ncp/bin/ncp
generated
vendored
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
|
||||
|
||||
|
||||
var ncp = require('../lib/ncp'),
|
||||
args = process.argv.slice(2),
|
||||
source, dest;
|
||||
|
||||
if (args.length < 2) {
|
||||
console.error('Usage: ncp [source] [destination] [--filter=filter] [--limit=concurrency limit]');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// parse arguments the hard way
|
||||
function startsWith(str, prefix) {
|
||||
return str.substr(0, prefix.length) == prefix;
|
||||
}
|
||||
|
||||
var options = {};
|
||||
args.forEach(function (arg) {
|
||||
if (startsWith(arg, "--limit=")) {
|
||||
options.limit = parseInt(arg.split('=', 2)[1], 10);
|
||||
}
|
||||
if (startsWith(arg, "--filter=")) {
|
||||
options.filter = new RegExp(arg.split('=', 2)[1]);
|
||||
}
|
||||
if (startsWith(arg, "--stoponerr")) {
|
||||
options.stopOnErr = true;
|
||||
}
|
||||
});
|
||||
|
||||
ncp.ncp(args[0], args[1], options, function (err) {
|
||||
if (Array.isArray(err)) {
|
||||
console.error('There were errors during the copy.');
|
||||
err.forEach(function (err) {
|
||||
console.error(err.stack || err.message);
|
||||
});
|
||||
process.exit(1);
|
||||
}
|
||||
else if (err) {
|
||||
console.error('An error has occurred.');
|
||||
console.error(err.stack || err.message);
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
|
230
node_modules/metalsmith-static/node_modules/ncp/lib/ncp.js
generated
vendored
Normal file
230
node_modules/metalsmith-static/node_modules/ncp/lib/ncp.js
generated
vendored
Normal file
|
@ -0,0 +1,230 @@
|
|||
var fs = require('fs'),
|
||||
path = require('path');
|
||||
|
||||
module.exports = ncp;
|
||||
ncp.ncp = ncp;
|
||||
|
||||
function ncp (source, dest, options, callback) {
|
||||
var cback = callback;
|
||||
|
||||
if (!callback) {
|
||||
cback = options;
|
||||
options = {};
|
||||
}
|
||||
|
||||
var basePath = process.cwd(),
|
||||
currentPath = path.resolve(basePath, source),
|
||||
targetPath = path.resolve(basePath, dest),
|
||||
filter = options.filter,
|
||||
transform = options.transform,
|
||||
clobber = options.clobber !== false,
|
||||
errs = null,
|
||||
eventName = /^v0\.10\.\d+$/.test(process.version) ? 'finish' : 'close',
|
||||
started = 0,
|
||||
finished = 0,
|
||||
running = 0,
|
||||
limit = options.limit || ncp.limit || 16;
|
||||
|
||||
limit = (limit < 1) ? 1 : (limit > 512) ? 512 : limit;
|
||||
|
||||
startCopy(currentPath);
|
||||
|
||||
function startCopy(source) {
|
||||
started++;
|
||||
if (filter) {
|
||||
if (filter instanceof RegExp) {
|
||||
if (!filter.test(source)) {
|
||||
return cb(true);
|
||||
}
|
||||
}
|
||||
else if (typeof filter === 'function') {
|
||||
if (!filter(source)) {
|
||||
return cb(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return getStats(source);
|
||||
}
|
||||
|
||||
function defer(fn) {
|
||||
if (typeof(setImmediate) === 'function')
|
||||
return setImmediate(fn);
|
||||
return process.nextTick(fn);
|
||||
}
|
||||
|
||||
function getStats(source) {
|
||||
if (running >= limit) {
|
||||
return defer(function () {
|
||||
getStats(source);
|
||||
});
|
||||
}
|
||||
running++;
|
||||
fs.lstat(source, function (err, stats) {
|
||||
var item = {};
|
||||
if (err) {
|
||||
return onError(err);
|
||||
}
|
||||
|
||||
// We need to get the mode from the stats object and preserve it.
|
||||
item.name = source;
|
||||
item.mode = stats.mode;
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
return onDir(item);
|
||||
}
|
||||
else if (stats.isFile()) {
|
||||
return onFile(item);
|
||||
}
|
||||
else if (stats.isSymbolicLink()) {
|
||||
// Symlinks don't really need to know about the mode.
|
||||
return onLink(source);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function onFile(file) {
|
||||
var target = file.name.replace(currentPath, targetPath);
|
||||
isWritable(target, function (writable) {
|
||||
if (writable) {
|
||||
return copyFile(file, target);
|
||||
}
|
||||
if(clobber) {
|
||||
rmFile(target, function () {
|
||||
copyFile(file, target);
|
||||
});
|
||||
} else {
|
||||
return cb();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function copyFile(file, target) {
|
||||
var readStream = fs.createReadStream(file.name),
|
||||
writeStream = fs.createWriteStream(target, { mode: file.mode });
|
||||
if(transform) {
|
||||
transform(readStream, writeStream,file);
|
||||
} else {
|
||||
readStream.pipe(writeStream);
|
||||
}
|
||||
writeStream.once(eventName, cb);
|
||||
}
|
||||
|
||||
function rmFile(file, done) {
|
||||
fs.unlink(file, function (err) {
|
||||
if (err) {
|
||||
return onError(err);
|
||||
}
|
||||
return done();
|
||||
});
|
||||
}
|
||||
|
||||
function onDir(dir) {
|
||||
var target = dir.name.replace(currentPath, targetPath);
|
||||
isWritable(target, function (writable) {
|
||||
if (writable) {
|
||||
return mkDir(dir, target);
|
||||
}
|
||||
copyDir(dir.name);
|
||||
});
|
||||
}
|
||||
|
||||
function mkDir(dir, target) {
|
||||
fs.mkdir(target, dir.mode, function (err) {
|
||||
if (err) {
|
||||
return onError(err);
|
||||
}
|
||||
copyDir(dir.name);
|
||||
});
|
||||
}
|
||||
|
||||
function copyDir(dir) {
|
||||
fs.readdir(dir, function (err, items) {
|
||||
if (err) {
|
||||
return onError(err);
|
||||
}
|
||||
items.forEach(function (item) {
|
||||
startCopy(dir + '/' + item);
|
||||
});
|
||||
return cb();
|
||||
});
|
||||
}
|
||||
|
||||
function onLink(link) {
|
||||
var target = link.replace(currentPath, targetPath);
|
||||
fs.readlink(link, function (err, resolvedPath) {
|
||||
if (err) {
|
||||
return onError(err);
|
||||
}
|
||||
checkLink(resolvedPath, target);
|
||||
});
|
||||
}
|
||||
|
||||
function checkLink(resolvedPath, target) {
|
||||
isWritable(target, function (writable) {
|
||||
if (writable) {
|
||||
return makeLink(resolvedPath, target);
|
||||
}
|
||||
fs.readlink(target, function (err, targetDest) {
|
||||
if (err) {
|
||||
return onError(err);
|
||||
}
|
||||
if (targetDest === resolvedPath) {
|
||||
return cb();
|
||||
}
|
||||
return rmFile(target, function () {
|
||||
makeLink(resolvedPath, target);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function makeLink(linkPath, target) {
|
||||
fs.symlink(linkPath, target, function (err) {
|
||||
if (err) {
|
||||
return onError(err);
|
||||
}
|
||||
return cb();
|
||||
});
|
||||
}
|
||||
|
||||
function isWritable(path, done) {
|
||||
fs.lstat(path, function (err) {
|
||||
if (err) {
|
||||
if (err.code === 'ENOENT') return done(true);
|
||||
return done(false);
|
||||
}
|
||||
return done(false);
|
||||
});
|
||||
}
|
||||
|
||||
function onError(err) {
|
||||
if (options.stopOnError) {
|
||||
return cback(err);
|
||||
}
|
||||
else if (!errs && options.errs) {
|
||||
errs = fs.createWriteStream(options.errs);
|
||||
}
|
||||
else if (!errs) {
|
||||
errs = [];
|
||||
}
|
||||
if (typeof errs.write === 'undefined') {
|
||||
errs.push(err);
|
||||
}
|
||||
else {
|
||||
errs.write(err.stack + '\n\n');
|
||||
}
|
||||
return cb();
|
||||
}
|
||||
|
||||
function cb(skipped) {
|
||||
if (!skipped) running--;
|
||||
finished++;
|
||||
if ((started === finished) && (running === 0)) {
|
||||
if (cback !== undefined ) {
|
||||
return errs ? cback(errs) : cback(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
88
node_modules/metalsmith-static/node_modules/ncp/package.json
generated
vendored
Normal file
88
node_modules/metalsmith-static/node_modules/ncp/package.json
generated
vendored
Normal file
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"ncp@~0.5.0",
|
||||
"/Users/okennedy/Documents/Website/node_modules/metalsmith-static"
|
||||
]
|
||||
],
|
||||
"_from": "ncp@>=0.5.0 <0.6.0",
|
||||
"_id": "ncp@0.5.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/metalsmith-static/ncp",
|
||||
"_npmUser": {
|
||||
"email": "charlie@charlieistheman.com",
|
||||
"name": "avianflu"
|
||||
},
|
||||
"_npmVersion": "1.4.3",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "ncp",
|
||||
"raw": "ncp@~0.5.0",
|
||||
"rawSpec": "~0.5.0",
|
||||
"scope": null,
|
||||
"spec": ">=0.5.0 <0.6.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/metalsmith-static"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ncp/-/ncp-0.5.1.tgz",
|
||||
"_shasum": "743985316e3db459281b587169e845735a05439f",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "ncp@~0.5.0",
|
||||
"_where": "/Users/okennedy/Documents/Website/node_modules/metalsmith-static",
|
||||
"author": {
|
||||
"email": "charlie@charlieistheman.com",
|
||||
"name": "AvianFlu"
|
||||
},
|
||||
"bin": {
|
||||
"ncp": "./bin/ncp"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/AvianFlu/ncp/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Asynchronous recursive file copy utility.",
|
||||
"devDependencies": {
|
||||
"mocha": "1.15.x",
|
||||
"read-dir-files": "0.0.x",
|
||||
"rimraf": "1.0.x"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "743985316e3db459281b587169e845735a05439f",
|
||||
"tarball": "http://registry.npmjs.org/ncp/-/ncp-0.5.1.tgz"
|
||||
},
|
||||
"engine": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"homepage": "https://github.com/AvianFlu/ncp",
|
||||
"keywords": [
|
||||
"cli",
|
||||
"copy"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/ncp.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "avianflu",
|
||||
"email": "charlie@charlieistheman.com"
|
||||
},
|
||||
{
|
||||
"name": "mmalecki",
|
||||
"email": "me@mmalecki.com"
|
||||
}
|
||||
],
|
||||
"name": "ncp",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/AvianFlu/ncp.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha -R spec"
|
||||
},
|
||||
"version": "0.5.1"
|
||||
}
|
1
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/a
generated
vendored
Normal file
1
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/a
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
Hello world
|
1
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/b
generated
vendored
Normal file
1
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/b
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
Hello ncp
|
0
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/c
generated
vendored
Normal file
0
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/c
generated
vendored
Normal file
0
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/d
generated
vendored
Normal file
0
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/d
generated
vendored
Normal file
0
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/e
generated
vendored
Normal file
0
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/e
generated
vendored
Normal file
0
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/f
generated
vendored
Normal file
0
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/f
generated
vendored
Normal file
1
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/sub/a
generated
vendored
Normal file
1
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/sub/a
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
Hello nodejitsu
|
0
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/sub/b
generated
vendored
Normal file
0
node_modules/metalsmith-static/node_modules/ncp/test/fixtures/src/sub/b
generated
vendored
Normal file
86
node_modules/metalsmith-static/node_modules/ncp/test/ncp.js
generated
vendored
Normal file
86
node_modules/metalsmith-static/node_modules/ncp/test/ncp.js
generated
vendored
Normal file
|
@ -0,0 +1,86 @@
|
|||
|
||||
|
||||
var assert = require('assert'),
|
||||
path = require('path'),
|
||||
rimraf = require('rimraf'),
|
||||
readDirFiles = require('read-dir-files'),
|
||||
ncp = require('../').ncp;
|
||||
|
||||
|
||||
var fixtures = path.join(__dirname, 'fixtures'),
|
||||
src = path.join(fixtures, 'src'),
|
||||
out = path.join(fixtures, 'out');
|
||||
|
||||
describe('ncp', function () {
|
||||
before(function (cb) {
|
||||
rimraf(out, function() {
|
||||
ncp(src, out, cb);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when copying a directory of files', function () {
|
||||
it('files are copied correctly', function (cb) {
|
||||
readDirFiles(src, 'utf8', function (srcErr, srcFiles) {
|
||||
readDirFiles(out, 'utf8', function (outErr, outFiles) {
|
||||
assert.ifError(srcErr);
|
||||
assert.deepEqual(srcFiles, outFiles);
|
||||
cb();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('when copying files using filter', function () {
|
||||
before(function (cb) {
|
||||
var filter = function(name) {
|
||||
return name.substr(name.length - 1) != 'a';
|
||||
};
|
||||
rimraf(out, function () {
|
||||
ncp(src, out, {filter: filter}, cb);
|
||||
});
|
||||
});
|
||||
|
||||
it('files are copied correctly', function (cb) {
|
||||
readDirFiles(src, 'utf8', function (srcErr, srcFiles) {
|
||||
function filter(files) {
|
||||
for (var fileName in files) {
|
||||
var curFile = files[fileName];
|
||||
if (curFile instanceof Object)
|
||||
return filter(curFile);
|
||||
if (fileName.substr(fileName.length - 1) == 'a')
|
||||
delete files[fileName];
|
||||
}
|
||||
}
|
||||
filter(srcFiles);
|
||||
readDirFiles(out, 'utf8', function (outErr, outFiles) {
|
||||
assert.ifError(outErr);
|
||||
assert.deepEqual(srcFiles, outFiles);
|
||||
cb();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('when using clobber=false', function () {
|
||||
it('the copy is completed successfully', function (cb) {
|
||||
ncp(src, out, function() {
|
||||
ncp(src, out, {clobber: false}, function(err) {
|
||||
assert.ifError(err);
|
||||
cb();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('when using transform', function () {
|
||||
it('file descriptors are passed correctly', function (cb) {
|
||||
ncp(src, out, {
|
||||
transform: function(read,write,file) {
|
||||
assert.notEqual(file.name, undefined);
|
||||
assert.strictEqual(typeof file.mode,'number');
|
||||
read.pipe(write);
|
||||
}
|
||||
}, cb);
|
||||
});
|
||||
});
|
||||
});
|
74
node_modules/metalsmith-static/package.json
generated
vendored
Normal file
74
node_modules/metalsmith-static/package.json
generated
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"metalsmith-static",
|
||||
"/Users/okennedy/Documents/Website"
|
||||
]
|
||||
],
|
||||
"_from": "metalsmith-static@*",
|
||||
"_id": "metalsmith-static@0.0.5",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/metalsmith-static",
|
||||
"_npmUser": {
|
||||
"email": "dnfagnan@gmail.com",
|
||||
"name": "thehydroimpulse"
|
||||
},
|
||||
"_npmVersion": "1.4.21",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "metalsmith-static",
|
||||
"raw": "metalsmith-static",
|
||||
"rawSpec": "",
|
||||
"scope": null,
|
||||
"spec": "*",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/metalsmith-static/-/metalsmith-static-0.0.5.tgz",
|
||||
"_shasum": "c0f51305ae75442faa0e1652657ef2c22406ba2f",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "metalsmith-static",
|
||||
"_where": "/Users/okennedy/Documents/Website",
|
||||
"author": {
|
||||
"name": "Daniel Fagnan"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/thehydroimpulse/metalsmith-static/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "~0.7.4",
|
||||
"fs-extra": "~0.10.0",
|
||||
"ncp": "~0.5.0"
|
||||
},
|
||||
"description": "Provides a simple plugin to copy assets from /public (configurable) to the build directory.",
|
||||
"devDependencies": {
|
||||
"assert-dir-equal": "0.0.1",
|
||||
"metalsmith": "1.x"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "c0f51305ae75442faa0e1652657ef2c22406ba2f",
|
||||
"tarball": "http://registry.npmjs.org/metalsmith-static/-/metalsmith-static-0.0.5.tgz"
|
||||
},
|
||||
"gitHead": "8eb0b3235e9c57caf8043215955dca2d2cfa468e",
|
||||
"homepage": "https://github.com/thehydroimpulse/metalsmith-static",
|
||||
"main": "lib/index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "thehydroimpulse",
|
||||
"email": "dnfagnan@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "metalsmith-static",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/thehydroimpulse/metalsmith-static.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"version": "0.0.5"
|
||||
}
|
2
node_modules/metalsmith-static/test/fixtures/one/build/one.md
generated
vendored
Normal file
2
node_modules/metalsmith-static/test/fixtures/one/build/one.md
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
one
|
0
node_modules/metalsmith-static/test/fixtures/one/build/public/styles.css
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/one/build/public/styles.css
generated
vendored
Normal file
2
node_modules/metalsmith-static/test/fixtures/one/expected/one.md
generated
vendored
Normal file
2
node_modules/metalsmith-static/test/fixtures/one/expected/one.md
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
one
|
0
node_modules/metalsmith-static/test/fixtures/one/expected/public/styles.css
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/one/expected/public/styles.css
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/one/public/styles.css
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/one/public/styles.css
generated
vendored
Normal file
5
node_modules/metalsmith-static/test/fixtures/one/src/one.md
generated
vendored
Normal file
5
node_modules/metalsmith-static/test/fixtures/one/src/one.md
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
collection: articles
|
||||
---
|
||||
|
||||
one
|
0
node_modules/metalsmith-static/test/fixtures/recurse/assets/media/css/styles.css
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/recurse/assets/media/css/styles.css
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/recurse/build/css/style.css
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/recurse/build/css/style.css
generated
vendored
Normal file
2
node_modules/metalsmith-static/test/fixtures/recurse/build/one.md
generated
vendored
Normal file
2
node_modules/metalsmith-static/test/fixtures/recurse/build/one.md
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
one
|
0
node_modules/metalsmith-static/test/fixtures/recurse/expected/css/style.css
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/recurse/expected/css/style.css
generated
vendored
Normal file
2
node_modules/metalsmith-static/test/fixtures/recurse/expected/one.md
generated
vendored
Normal file
2
node_modules/metalsmith-static/test/fixtures/recurse/expected/one.md
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
one
|
5
node_modules/metalsmith-static/test/fixtures/recurse/src/one.md
generated
vendored
Normal file
5
node_modules/metalsmith-static/test/fixtures/recurse/src/one.md
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
collection: articles
|
||||
---
|
||||
|
||||
one
|
0
node_modules/metalsmith-static/test/fixtures/two/build/script.js
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/two/build/script.js
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/two/build/styles.css
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/two/build/styles.css
generated
vendored
Normal file
2
node_modules/metalsmith-static/test/fixtures/two/build/two.md
generated
vendored
Normal file
2
node_modules/metalsmith-static/test/fixtures/two/build/two.md
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
one
|
0
node_modules/metalsmith-static/test/fixtures/two/expected/script.js
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/two/expected/script.js
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/two/expected/styles.css
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/two/expected/styles.css
generated
vendored
Normal file
2
node_modules/metalsmith-static/test/fixtures/two/expected/two.md
generated
vendored
Normal file
2
node_modules/metalsmith-static/test/fixtures/two/expected/two.md
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
one
|
0
node_modules/metalsmith-static/test/fixtures/two/public/script.js
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/two/public/script.js
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/two/public/styles.css
generated
vendored
Normal file
0
node_modules/metalsmith-static/test/fixtures/two/public/styles.css
generated
vendored
Normal file
5
node_modules/metalsmith-static/test/fixtures/two/src/two.md
generated
vendored
Normal file
5
node_modules/metalsmith-static/test/fixtures/two/src/two.md
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
collection: articles
|
||||
---
|
||||
|
||||
one
|
70
node_modules/metalsmith-static/test/index.js
generated
vendored
Normal file
70
node_modules/metalsmith-static/test/index.js
generated
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
var Metalsmith = require('metalsmith');
|
||||
var assert = require('assert');
|
||||
var equal = require('assert-dir-equal');
|
||||
var asset = require('..');
|
||||
var fs = require('fs-extra');
|
||||
|
||||
describe('test', function() {
|
||||
it('should copy file', function(done) {
|
||||
var metalsmith = Metalsmith('test/fixtures/one');
|
||||
|
||||
fs.removeSync('test/fixtures/one/build/*');
|
||||
|
||||
metalsmith
|
||||
.clean(false)
|
||||
.use(asset())
|
||||
.build(function(err) {
|
||||
if (err) return done(err);
|
||||
|
||||
equal('test/fixtures/one/expected', 'test/fixtures/one/build');
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should be able to be called multiple times', function(done) {
|
||||
var metalsmith = Metalsmith('test/fixtures/two');
|
||||
|
||||
fs.removeSync('test/fixtures/two/build/*');
|
||||
|
||||
metalsmith
|
||||
.clean(false)
|
||||
.use(asset({
|
||||
"src": "public/styles.css",
|
||||
"dest": "styles.css",
|
||||
}))
|
||||
.use(asset({
|
||||
"src": "public/script.js",
|
||||
"dest": "script.js",
|
||||
}))
|
||||
.build(function(err) {
|
||||
if (err) return done(err);
|
||||
|
||||
equal('test/fixtures/two/expected', 'test/fixtures/two/build');
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should create destination directory recursively', function(done) {
|
||||
var metalsmith = Metalsmith('test/fixtures/recurse');
|
||||
|
||||
fs.removeSync('test/fixtures/recurse/build/');
|
||||
|
||||
metalsmith
|
||||
.clean(false)
|
||||
.use(asset({
|
||||
"src": "assets/media/css/styles.css",
|
||||
"dest": "css/style.css",
|
||||
"createDest": true
|
||||
}))
|
||||
.build(function(err) {
|
||||
if (err) return done(err);
|
||||
|
||||
equal('test/fixtures/recurse/expected', 'test/fixtures/recurse/build');
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -3,6 +3,8 @@ title: CSE 462 - Spring 2016
|
|||
classContent:
|
||||
- date: Jan. 26
|
||||
topic: Introduction and Outline
|
||||
meta:
|
||||
- slides: 01-IntroAndStructure.pdf
|
||||
- date: Jan. 28
|
||||
topic: Relational Algebra
|
||||
- date: Feb. 2
|
||||
|
@ -79,7 +81,7 @@ In this course, you will learn...
|
|||
|
||||
## Course Details
|
||||
|
||||
* __Class__: T/Th, 12:30-1:50 PM in <a href="http://www.buffalo.edu/buildings/building?id=nsc">NSC 222</a>
|
||||
* __Class__: T/Th, 12:30-1:50 PM in <a href="http://www.buffalo.edu/buildings/building?id=nsc">NSC 220</a>
|
||||
* __Class Forum__: <a href="https://piazza.com/buffalo/spring2016/cse462/home">Piazza</a>
|
||||
* __Textbook__: "Database Systems, The Complete Book" 2nd Edition<br/> by Garcia-Molina, Ullman, and Widom.
|
||||
* __Optional Readings__:
|
||||
|
@ -100,40 +102,42 @@ In this course, you will learn...
|
|||
* OR 5%/10%/25% OR 5%/5%/30% (whichever is most advantageous to you)
|
||||
* 50% Projects
|
||||
* 5% <a title="Checkpoint 0" href="{{{rootPath}}}teaching/dubstep/checkpoint0.html">Hello World</a> due on Feb. 8, 11:59 PM
|
||||
* 15% <a title="Checkpoint 1" href="{{{rootPath}}}dubstep/checkpoint1.html">Project 1</a> due on Feb. 22, 11:59 PM
|
||||
* 15% <a title="Checkpoint 2" href="{{{rootPath}}}dubstep/checkpoint2.html">Project 2</a> due on Mar. 28, 11:59 PM
|
||||
* 15% <a title="Checkpoint 3" href="{{{rootPath}}}dubstep/checkpoint3.html">Project 3</a> due on May 8, 11:59 PM
|
||||
* 15% <a title="Checkpoint 1" href="{{{rootPath}}}teaching/dubstep/checkpoint1.html">Project 1</a> due on Feb. 22, 11:59 PM
|
||||
* 15% <a title="Checkpoint 2" href="{{{rootPath}}}teaching/dubstep/checkpoint2.html">Project 2</a> due on Mar. 28, 11:59 PM
|
||||
* 15% <a title="Checkpoint 3" href="{{{rootPath}}}teaching/dubstep/checkpoint3.html">Project 3</a> due on May 8, 11:59 PM
|
||||
|
||||
------
|
||||
|
||||
## Library Documentation
|
||||
|
||||
* __JSqlParser__ (<a href="{{{rootPath}}}software/jsqlparser/jsqlparser.jar">binary</a>, <a href="https://github.com/UBOdin/jsqlparser">source</a>, <a href="{{{rootPath}}}software/jsqlparser/">docs</a>, <a href="https://youtu.be/U4TyaHTJ3Zg">Demo</a>)
|
||||
* __JSqlParser__ (<a href="/software/jsqlparser/jsqlparser.jar">binary</a>, <a href="https://github.com/UBOdin/jsqlparser">source</a>, <a href="/software/jsqlparser/">docs</a>, <a href="https://youtu.be/U4TyaHTJ3Zg">Demo</a>)
|
||||
|
||||
------
|
||||
|
||||
## Lecture Schedule
|
||||
|
||||
{{#each classContent}}
|
||||
* _{{date}}_: {{topic}}
|
||||
* _{{date}}_: {{topic}}{{#if meta}}(
|
||||
{{#if meta.slides}}<a href="slides/{{meta.slides}}">slides</a>{{/if}}
|
||||
{{list meta}}){{/if}}
|
||||
{{/each}}
|
||||
|
||||
------
|
||||
|
||||
## Content Outline
|
||||
* <a title="Checkpoint 0" href="{{{rootPath}}}dubstep/checkpoint0.html">Project 0</a> - Basic Setup
|
||||
* <a title="Checkpoint 1" href="{{{rootPath}}}dubstep/checkpoint1.html">Project 1</a> - Infrastructure & Query Evaluation
|
||||
* <a title="Checkpoint 0" href="{{{rootPath}}}teaching/dubstep/checkpoint0.html">Project 0</a> - Basic Setup
|
||||
* <a title="Checkpoint 1" href="{{{rootPath}}}teaching/dubstep/checkpoint1.html">Project 1</a> - Infrastructure & Query Evaluation
|
||||
* __Relational Algebra__ (Ch 2.4, 5.1)
|
||||
* __SQL__ (Ch 2.3 and 6.1-6.4)
|
||||
* __Query Compilers__ (Ch 15.1-15.3, 16.1, 16.3)
|
||||
* __Data Modeling__ (Ch 2.1-2.2)
|
||||
* <a title="Checkpoint 2" href="{{{rootPath}}}dubstep/checkpoint2.html">Project 2</a> - Optimization & External Algorithms
|
||||
* <a title="Checkpoint 2" href="{{{rootPath}}}teaching/dubstep/checkpoint2.html">Project 2</a> - Optimization & External Algorithms
|
||||
* __Algebraic Query Optimization__ (Ch 16.2)
|
||||
* __Join Algorithms__ (Ch 15.4, 15.5)
|
||||
* __Extended Relational Algebra__ (Ch 5.2)
|
||||
* __Buffering & External Algorithms__ (Ch 15.7-15.8)
|
||||
* __Physical Plans__ (Ch 16.7)
|
||||
* <a title="Checkpoint 3" href="{{{rootPath}}}dubstep/checkpoint3.html">Project 3</a> - Indexing & Physical Layout
|
||||
* <a title="Checkpoint 3" href="{{{rootPath}}}teaching/dubstep/checkpoint3.html">Project 3</a> - Indexing & Physical Layout
|
||||
* __The Memory Hierarchy__ (Ch 13.1-13.3)
|
||||
* __Physical Design__ (Ch 13.5-13.7)
|
||||
* __Indexing__ (Ch 8.3, 14.1-14.4)
|
||||
|
|
BIN
src/teaching/cse-462/slides/01-IntroAndStructure.pdf
Normal file
BIN
src/teaching/cse-462/slides/01-IntroAndStructure.pdf
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue