diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-11-18 23:56:25 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-11-18 23:56:25 +0100 |
commit | b23284cba28335f61595f2264685b1bbafc19183 (patch) | |
tree | 696cbfc2b5a609c636e0d1d7a3a2f9ad7a302266 /library/moment/tasks/size.js | |
parent | 0c163c4d038a4c26335af1bde366d8ef9e53c464 (diff) | |
download | volse-hubzilla-b23284cba28335f61595f2264685b1bbafc19183.tar.gz volse-hubzilla-b23284cba28335f61595f2264685b1bbafc19183.tar.bz2 volse-hubzilla-b23284cba28335f61595f2264685b1bbafc19183.zip |
move moment.min.js and remove unneeded files
Diffstat (limited to 'library/moment/tasks/size.js')
-rw-r--r-- | library/moment/tasks/size.js | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/library/moment/tasks/size.js b/library/moment/tasks/size.js deleted file mode 100644 index 2ab380e9f..000000000 --- a/library/moment/tasks/size.js +++ /dev/null @@ -1,59 +0,0 @@ -var https = require('https'), - zlib = require('zlib'), - path = require('path'), - fs = require('fs'); - -var stable = '1.7.1', - done; - -function getVersion(path, cb) { - var data = '', - req = https.request({ - host: 'raw.github.com', - port: 443, - path: '/timrwood/moment/' + path - }, function (res) { - res.setEncoding('utf8'); - res.on('data', function (chunk) { - data += chunk; - }); - res.on('end', function (e) { - zlib.gzip(data, function (error, result) { - cb(data.length, result.length); - }); - }); - }); - req.on('error', function (e) { - console.log('problem with request: ' + e.message); - }); - req.end(); -} - -function printDiffs(stableLen, stableGzip, currentLen, currentGzip) { - var diff = currentLen - stableLen, - gzipDiff = currentGzip - stableGzip; - - console.log('Filesize difference from current branch to ' + stable); - console.log(stable + ' ' + stableLen + ' / ' + stableGzip); - console.log('curr ' + currentLen + ' / ' + currentGzip); - console.log('diff ' + (diff > 0 ? '+' : '') + diff); - console.log('gzip ' + (gzipDiff > 0 ? '+' : '') + gzipDiff); -} - - -module.exports = function (grunt) { - grunt.registerTask('size', 'Check the codebase filesize against the latest stable version.', function () { - done = this.async(); - fs.readFile(path.normalize(__dirname + '/../min/moment.min.js'), 'utf8', function (err, data) { - if (err) { - throw err; - } - zlib.gzip(data, function (error, result) { - getVersion(stable + '/min/moment.min.js', function (stableLength, stableGzipLength) { - printDiffs(stableLength, stableGzipLength, data.length, result.length); - done(); - }); - }); - }); - }); -}; |