Switch file names from jade to pug.

This commit is contained in:
Lars Jung 2016-06-04 02:43:48 +02:00
parent 3a2e61b163
commit f0a9937dc6
8 changed files with 57 additions and 7 deletions

View file

@ -16,7 +16,7 @@ trim_trailing_whitespace = true
indent_size = 2
[{*.md,*.jade}]
[{*.md,*.jade,*.pug}]
trim_trailing_whitespace = false

8
ghu.js
View file

@ -9,7 +9,7 @@ const SRC = join(ROOT, 'src');
const TEST = join(ROOT, 'test');
const BUILD = join(ROOT, 'build');
const mapper = mapfn.p(SRC, BUILD).s('.less', '.css').s('.jade', '');
const mapper = mapfn.p(SRC, BUILD).s('.less', '.css').s('.pug', '');
ghu.defaults('release');
@ -88,8 +88,8 @@ ghu.task('build:styles', runtime => {
});
ghu.task('build:pages', runtime => {
return read(`${SRC}: **/*.jade, ! **/*.tpl.jade`)
.then(newerThan(mapper, `${SRC}/**/*.tpl.jade`))
return read(`${SRC}: **/*.pug, ! **/*.tpl.pug`)
.then(newerThan(mapper, `${SRC}/**/*.tpl.pug`))
.then(pug({pkg: runtime.pkg}))
.then(wrap('', runtime.commentHtml))
.then(write(mapper, {overwrite: true}));
@ -104,7 +104,7 @@ ghu.task('build:copy', runtime => {
.then(wrap(runtime.commentJs))
.then(write(mapper, {overwrite: true, cluster: true})),
read(`${SRC}: **, ! **/*.js, ! **/*.less, ! **/*.jade, ! **/conf/*.json`)
read(`${SRC}: **, ! **/*.js, ! **/*.less, ! **/*.pug, ! **/conf/*.json`)
.then(newerThan(mapper))
.then(each(obj => {
if (/index\.php$/.test(obj.source)) {

View file

@ -1,4 +1,4 @@
extends ./page.tpl.jade
extends ./page.tpl.pug
block init
- var title = 'index - powered by h5ai v' + pkg.version + ' (' + pkg.homepage + ')'

View file

@ -1,4 +1,4 @@
extends ./page.tpl.jade
extends ./page.tpl.pug
block init
- var title = 'h5ai info page - v' + pkg.version

View file

@ -2,6 +2,8 @@ const {test} = require('scar');
const {pinHtml} = require('./util/pin');
require('./tests/premisses');
require('./tests/unit/core/event');
require('./tests/unit/core/format');
pinHtml();

View file

@ -0,0 +1,22 @@
const {test, assert} = require('scar');
const event = require('../../../../src/_h5ai/public/js/lib/core/event');
test('event is object', () => {
assert.equal(typeof event, 'object');
});
test('event has the right props', () => {
assert.deepEqual(Object.keys(event), ['sub', 'unsub', 'pub']);
});
test('event.sub is function', () => {
assert.equal(typeof event.sub, 'function');
});
test('event.unsub is function', () => {
assert.equal(typeof event.unsub, 'function');
});
test('event.pub is function', () => {
assert.equal(typeof event.pub, 'function');
});

View file

@ -0,0 +1,26 @@
const {test, assert} = require('scar');
const format = require('../../../../src/_h5ai/public/js/lib/core/format');
test('format is object', () => {
assert.equal(typeof format, 'object');
});
test('format has the right props', () => {
assert.deepEqual(Object.keys(format), ['setDefaultMetric', 'formatSize', 'setDefaultDateFormat', 'formatDate']);
});
test('format.setDefaultMetric is function', () => {
assert.equal(typeof format.setDefaultMetric, 'function');
});
test('format.formatSize is function', () => {
assert.equal(typeof format.formatSize, 'function');
});
test('format.setDefaultDateFormat is function', () => {
assert.equal(typeof format.setDefaultDateFormat, 'function');
});
test('format.formatDate is function', () => {
assert.equal(typeof format.formatDate, 'function');
});