diff --git a/.travis.yml b/.travis.yml index f5d98e3a..268c1430 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ node_js: - 0.12 script: - - npm run yaspeller - npm test notifications: diff --git a/gulp/docs.js b/bin/release.js old mode 100644 new mode 100755 similarity index 62% rename from gulp/docs.js rename to bin/release.js index 80fe6545..8eeec68d --- a/gulp/docs.js +++ b/bin/release.js @@ -1,15 +1,24 @@ +#!/usr/bin/env node + (function() { 'use strict'; var DIR = '../', + Info = require(DIR + 'package'), - cl = require('./cl'), + minor = require('minor'), place = require('place'), rendy = require('rendy'), shortdate = require('shortdate'), - Info = require(DIR + 'package'); - module.exports = function(callback) { + ERROR = Error('ERROR: version is missing. release --patch|--minor|--major'); + + main(function(error) { + if (error) + console.error(error.message); + }); + + function main(callback) { var history = 'Version history\n---------------\n', link = '//github.com/cloudcmd/archive/raw/master/cloudcmd', template = '- *{{ date }}*, ' + @@ -32,7 +41,7 @@ }); } }); - }; + } function replaceVersion(name, version, versionNew, callback) { place(name, version, versionNew, function(error) { @@ -44,4 +53,23 @@ callback(error, msg); }); } + + function cl(callback) { + var versionNew, error, + argv = process.argv, + length = argv.length - 1, + last = process.argv[length], + regExp = /^--(major|minor|patch)$/, + match = last.match(regExp); + + if (!regExp.test(last)) + error = ERROR; + else if (match[1]) + versionNew = minor(match[1], Info.version); + else + versionNew = last.substr(3); + + callback(error, versionNew); + } })(); + diff --git a/bower.json b/bower.json index 40bef949..42dd80da 100644 --- a/bower.json +++ b/bower.json @@ -8,12 +8,20 @@ "description": "orthodox web file manager with console and editor", "main": "bin/cloudcmd.js", "keywords": [ + "console", + "editor", "file", + "file manager", + "folder", "orthodox", - "file", - "manager" + "view", + "copy", + "rename", + "move", + "delete", + "file operation" ], - "license": "MIT", + "license": "MIT", "private": true, "ignore": [ "node_modules", diff --git a/gulp/cl.js b/gulp/cl.js deleted file mode 100644 index fb1ca6e4..00000000 --- a/gulp/cl.js +++ /dev/null @@ -1,33 +0,0 @@ -(function() { - 'use strict'; - - var DIR = '../', - minor = require('minor'), - Info = require(DIR + 'package'), - ERROR = Error('ERROR: version is missing. gulp package --v or --major --minor --patch'), - - Version; - - module.exports = function(callback) { - var versionNew, error, - argv = process.argv, - length = argv.length - 1, - last = process.argv[length], - regExp = /^--(major|minor|patch)?/, - match = last.match(regExp); - - if (!Version) - if (!regExp.test(last)) { - error = ERROR; - } else { - if (match[1]) - versionNew = minor(match[1], Info.version); - else - versionNew = last.substr(3); - - Version = versionNew; - } - - callback(error, Version); - }; -})(); diff --git a/lib/client/contact/olark.js b/lib/client/contact/olark.js index ad046a81..d0fad770 100644 --- a/lib/client/contact/olark.js +++ b/lib/client/contact/olark.js @@ -1,3 +1,5 @@ +// jscs:disable +/* jshint ignore:start */ window.olark || (function (c) { var f = window, d = document, @@ -84,4 +86,7 @@ window.olark || (function (c) { methods: ["configure", "extend", "declare", "identify"] }); /* custom configuration goes here (www.olark.com/documentation) */ -olark.identify('6216-545-10-4223'); \ No newline at end of file +olark.identify('6216-545-10-4223'); + +/* jshint ignore:end */ + diff --git a/lib/util.js b/lib/util.js index 21867787..393b3a5b 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1,17 +1,17 @@ (function(scope) { 'use strict'; - var Scope = scope.window ? window : global; - - /* global rendy */ - - var exec; + var exec, + rendy, + Scope = scope.window ? window : global; if (typeof module === 'object' && module.exports) { exec = require('execon'); + rendy = require('rendy'); module.exports = new UtilProto(exec); } else if (!Scope.Util) { exec = window.exec; + rendy = window.rendy; Scope.Util = new UtilProto(exec); } diff --git a/package.json b/package.json index 57c19227..7c2fef99 100644 --- a/package.json +++ b/package.json @@ -14,20 +14,32 @@ "file", "file manager", "folder", - "orthodox" + "orthodox", + "view", + "copy", + "rename", + "move", + "delete", + "file operation" ], "bin": { "cloudcmd": "bin/cloudcmd.js" }, + "config": { + "dirs": "bin lib test" + }, "scripts": { "bower": "bower", "bupdate": "bupdate", - "gulp": "gulp", "nupdate": "nupdate", "start": "node bin/cloudcmd.js", - "test": "gulp default", - "wisdom": "gulp release", - "yaspeller": "yaspeller ." + "test": "npm-run-all --parallel lint:* codestyle spell mocha", + "lint:css": "recess css/*.css", + "lint:js": "jshint $npm_package_config_dirs", + "codestyle": "jscs --esnext $npm_package_config_dirs", + "mocha": "mocha test/lib", + "spell": "yaspeller .", + "wisdom": "bin/release.js" }, "directories": { "man": "man" @@ -72,17 +84,16 @@ "devDependencies": { "bower": "^1.5.3", "bupdate": "^1.0.4", - "gulp": "^3.9.0", - "gulp-jscs": "^3.0.0", - "gulp-jshint": "^2.0.0", - "gulp-mocha": "^2.2.0", - "gulp-recess": "^1.2.0", + "jscs": "^2.7.0", "jshint": "^2.8.0", - "minor": "~1.2.2", + "minor": "^1.2.2", + "mocha": "^2.3.4", "morgan": "~1.6.0", + "npm-run-all": "^1.4.0", "nupdate": "^2.1.0", "place": "~1.1.2", - "shortdate": "~1.0.1", + "recess": "^1.1.9", + "shortdate": "^1.0.1", "should": "^8.0.0", "yaspeller": "^2.6.0" }, diff --git a/test/lib/cloudfunc.js b/test/lib/cloudfunc.js index 27f4d11c..bd851195 100644 --- a/test/lib/cloudfunc.js +++ b/test/lib/cloudfunc.js @@ -1,6 +1,8 @@ (function() { 'use strict'; + /* global describe, it */ + var DIR = __dirname + '/../../', LIBDIR = DIR + 'lib/', TMPLDIR = DIR + 'tmpl/', @@ -49,8 +51,14 @@ '/X11/' + '' + ''; + + describe('cloudfunc', function() { + it('should check', function() { + check(); + }); + }); - exports.check = function() { + function check() { var paths = {}, filesList = TMPL_PATH.map(function(name) { @@ -114,5 +122,5 @@ } } }); - }; + } })();