Verified Commit 49cdc91f authored by Franz Geffke's avatar Franz Geffke 💬
Browse files

enabled ci build, cleanup

parent 02b5b273
.DS_Store
_site
.sass-cache
.jekyll-metadata
node_modules
yarn.lock
Gemfile.lock
package-lock.json
Gemfile.lock
assets/css
image: starefossen/ruby-node:latest
cache:
paths:
- vendor/
before_script:
- bundle install --path vendor
stages:
- build
- test
- deploy
build:
stage: build
script:
- apt-get update
- apt-get install -y graphicsmagick
- npm install --global gulp-cli
- yarn
- gulp
- JEKYLL_ENV=production bundle exec jekyll build -d public/
artifacts:
paths:
- public
test:
type: test
script:
- echo "TESTING..."
deploy:
stage: deploy
script:
- export AWS_ACCESS_KEY_ID="$(echo "$AWS_ACCESS_KEY_ID")"
- export AWS_SECRET_ACCESS_KEY="$(echo "$AWS_SECRET_ACCESS_KEY")"
- echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.list.d/java-8-debian.list
- echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.list.d/java-8-debian.list
- apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
- apt-get update
- echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections
- apt-get install -y oracle-java8-installer
- apt-get install -y oracle-java8-set-default
- bundle exec s3_website push
artifacts:
paths:
- public
only:
- master
......@@ -10,9 +10,6 @@ source "https://rubygems.org"
# Happy Jekylling!
gem "jekyll", "~> 3.8.2"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
......@@ -22,6 +19,7 @@ group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
gem "jekyll-minimagick"
gem "jekyll-sitemap"
gem "s3_website"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
......
......@@ -21,7 +21,12 @@ exclude:
- package.json
- .gitignore
- node_modules
- vendor
- s3_website.yml
- .gitlab-ci.yml
- gulpfile.js
- src
- README.md
collections:
- kunden
......
......@@ -48,11 +48,9 @@ gulp.task('js-fragebogen', function (cb) {
pump([
gulp.src
([
'node_modules/vue/dist/vue.js',
'node_modules/vue/dist/vue.min.js',
'node_modules/vue-localstorage/dist/vue-local-storage.min.js',
'node_modules/vee-validate/dist/vee-validate.js',
//'node_modules/axios/dist/axios.js',
//'node_modules/kbw-signature/dist/js/jquery.signature.min.js',
'src/fragebogen.js'
]),
concat('fragebogen.min.js'),
......
../bin-version-check/node_modules/semver/bin/semver
\ No newline at end of file
../normalize-package-data/node_modules/semver/bin/semver
\ No newline at end of file
This diff is collapsed.
../semver/bin/semver
\ No newline at end of file
../../../semver/bin/semver
\ No newline at end of file
# colors.js
# colors.js [![Build Status](https://travis-ci.org/Marak/colors.js.svg?branch=master)](https://travis-ci.org/Marak/colors.js)
## get color and style in your node.js console
<img src="https://github.com/Marak/colors.js/raw/master/screenshots/colors.png"/>
![Demo](https://raw.githubusercontent.com/Marak/colors.js/master/screenshots/colors.png)
## Installation
......@@ -25,8 +25,6 @@
### background colors
- bgBlack
- bgRed
- bgGreen
......@@ -162,6 +160,19 @@ console.log(colors.error("this is an error"));
// outputs yellow text
console.log(colors.warn("this is a warning"));
```
You can also combine them:
```javascript
var colors = require('colors');
colors.setTheme({
custom: ['red', 'underline']
});
console.log('test'.custom);
```
*Protip: There is a secret undocumented style in `colors`. If you find the style you can summon him.*
\ No newline at end of file
*Protip: There is a secret undocumented style in `colors`. If you find the style you can summon him.*
......@@ -48,6 +48,10 @@ colors.stripColors = colors.strip = function(str){
var stylize = colors.stylize = function stylize (str, style) {
if (!colors.enabled) {
return str+'';
}
return ansiStyles[style].open + str + ansiStyles[style].close;
}
......@@ -115,6 +119,13 @@ function applyTheme (theme) {
for (var style in theme) {
(function(style){
colors[style] = function(str){
if (typeof theme[style] === 'object'){
var out = str;
for (var i in theme[style]){
out = colors[theme[style][i]](out);
}
return out;
}
return colors[theme[style]](str);
};
})(style)
......
......@@ -58,10 +58,10 @@ module['exports'] = function zalgo(text, options) {
function heComes(text, options) {
var result = '', counts, l;
options = options || {};
options["up"] = options["up"] || true;
options["mid"] = options["mid"] || true;
options["down"] = options["down"] || true;
options["size"] = options["size"] || "maxi";
options["up"] = typeof options["up"] !== 'undefined' ? options["up"] : true;
options["mid"] = typeof options["mid"] !== 'undefined' ? options["mid"] : true;
options["down"] = typeof options["down"] !== 'undefined' ? options["down"] : true;
options["size"] = typeof options["size"] !== 'undefined' ? options["size"] : "maxi";
text = text.split('');
for (l in text) {
if (is_char(l)) {
......@@ -72,12 +72,12 @@ module['exports'] = function zalgo(text, options) {
switch (options.size) {
case 'mini':
counts.up = randomNumber(8);
counts.min = randomNumber(2);
counts.mid = randomNumber(2);
counts.down = randomNumber(8);
break;
case 'maxi':
counts.up = randomNumber(16) + 3;
counts.min = randomNumber(4) + 1;
counts.mid = randomNumber(4) + 1;
counts.down = randomNumber(64) + 3;
break;
default:
......@@ -100,5 +100,5 @@ module['exports'] = function zalgo(text, options) {
return result;
}
// don't summon him
return heComes(text);
return heComes(text, options);
}
var colors = require('./colors'),
styles = require('./styles');
var colors = require('./colors');
module['exports'] = function () {
......@@ -18,10 +17,6 @@ module['exports'] = function () {
}
};
var stylize = function stylize (str, style) {
return styles[style].open + str + styles[style].close;
}
addProperty('strip', function () {
return colors.strip(this);
});
......@@ -60,7 +55,7 @@ module['exports'] = function () {
var x = Object.keys(colors.styles);
x.forEach(function (style) {
addProperty(style, function () {
return stylize(this, style);
return colors.stylize(this, style);
});
});
......@@ -91,7 +86,7 @@ module['exports'] = function () {
addProperty(prop, function () {
var ret = this;
for (var t = 0; t < theme[prop].length; t++) {
ret = exports[theme[prop][t]](ret);
ret = colors[theme[prop][t]](ret);
}
return ret;
});
......
......@@ -9,4 +9,4 @@ module['exports'] = colors;
// colors.red("foo")
//
//
var extendStringPrototype = require('./extendStringPrototype')();
\ No newline at end of file
require('./extendStringPrototype')();
\ No newline at end of file
{
"name": "colors",
"description": "get colors in your node.js console",
"version": "1.0.3",
"version": "1.1.2",
"author": "Marak Squires",
"homepage": "https://github.com/Marak/colors.js",
"bugs": "https://github.com/Marak/colors.js/issues",
......@@ -17,5 +17,12 @@
"engines": {
"node": ">=0.1.90"
},
"main": "./lib/index"
"main": "lib",
"files": [
"examples",
"lib",
"LICENSE",
"safe.js",
"themes"
]
}
# Commander.js
[![Build Status](https://api.travis-ci.org/tj/commander.js.svg)](http://travis-ci.org/tj/commander.js)
[![Build Status](https://api.travis-ci.org/tj/commander.js.svg?branch=master)](http://travis-ci.org/tj/commander.js)
[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander)
[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://www.npmjs.org/package/commander)
[![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/tj/commander).
The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/commander-rb/commander).
[API documentation](http://tj.github.com/commander.js/)
## Installation
$ npm install commander
$ npm install commander --save
## Option parsing
......@@ -28,7 +28,7 @@
var program = require('commander');
program
.version('0.0.1')
.version('0.1.0')
.option('-p, --peppers', 'Add peppers')
.option('-P, --pineapple', 'Add pineapple')
.option('-b, --bbq-sauce', 'Add bbq sauce')
......@@ -44,6 +44,25 @@ console.log(' - %s cheese', program.cheese);
Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
Note that multi-word options starting with `--no` prefix negate the boolean value of the following word. For example, `--no-sauce` sets the value of `program.sauce` to false.
```js
#!/usr/bin/env node
/**
* Module dependencies.
*/
var program = require('commander');
program
.option('--no-sauce', 'Remove sauce')
.parse(process.argv);
console.log('you ordered a pizza');
if (program.sauce) console.log(' with sauce');
else console.log(' without sauce');
```
## Coercion
......@@ -66,7 +85,7 @@ function increaseVerbosity(v, total) {
}
program
.version('0.0.1')
.version('0.1.0')
.usage('[options] <file ...>')
.option('-i, --integer <n>', 'An integer argument', parseInt)
.option('-f, --float <n>', 'A float argument', parseFloat)
......@@ -91,7 +110,7 @@ console.log(' args: %j', program.args);
## Regular Expression
```js
program
.version('0.0.1')
.version('0.1.0')
.option('-s --size <size>', 'Pizza size', /^(large|medium|small)$/i, 'medium')
.option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i)
.parse(process.argv);
......@@ -115,7 +134,7 @@ console.log(' drink: %j', program.drink);
var program = require('commander');
program
.version('0.0.1')
.version('0.1.0')
.command('rmdir <dir> [otherDirs...]')
.action(function (dir, otherDirs) {
console.log('rmdir %s', dir);
......@@ -137,10 +156,10 @@ program.parse(process.argv);
```js
#!/usr/bin/env node
var program = require('../');
var program = require('commander');
program
.version('0.0.1')
.version('0.1.0')
.arguments('<cmd> [env]')
.action(function (cmd, env) {
cmdValue = cmd;
......@@ -156,15 +175,16 @@ if (typeof cmdValue === 'undefined') {
console.log('command:', cmdValue);
console.log('environment:', envValue || "no environment given");
```
Angled brackets (e.g. `<cmd>`) indicate required input. Square brackets (e.g. `[env]`) indicate optional input.
## Git-style sub-commands
```js
// file: ./examples/pm
var program = require('..');
var program = require('commander');
program
.version('0.0.1')
.version('0.1.0')
.command('install [name]', 'install one or more packages')
.command('search [query]', 'search with optional query')
.command('list', 'list packages installed', {isDefault: true})
......@@ -226,7 +246,7 @@ You can enable `--harmony` option in two ways:
var program = require('commander');
program
.version('0.0.1')
.version('0.1.0')
.option('-f, --foo', 'enable some foo')
.option('-b, --bar', 'enable some bar')
.option('-B, --baz', 'enable some baz');
......@@ -280,13 +300,13 @@ var program = require('commander');
var colors = require('colors');
program
.version('0.0.1')
.version('0.1.0')
.command('getstream [url]', 'get stream URL')
.parse(process.argv);
if (!process.argv.slice(2).length) {
program.outputHelp(make_red);
}
if (!process.argv.slice(2).length) {
program.outputHelp(make_red);
}
function make_red(txt) {
return colors.red(txt); //display the help text in red on the console
......@@ -304,10 +324,10 @@ function make_red(txt) {
var program = require('commander');
program
.version('0.0.1')
.version('0.1.0')
.option('-C, --chdir <path>', 'change the working directory')
.option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
.option('-T, --no-tests', 'ignore test hook')
.option('-T, --no-tests', 'ignore test hook');
program
.command('setup [env]')
......@@ -348,4 +368,3 @@ More Demos can be found in the [examples](https://github.com/tj/commander.js/tre
## License
MIT
......@@ -4,7 +4,6 @@
var EventEmitter = require('events').EventEmitter;
var spawn = require('child_process').spawn;
var readlink = require('graceful-readlink').readlinkSync;
var path = require('path');
var dirname = path.dirname;
var basename = path.basename;
......@@ -60,6 +59,18 @@ Option.prototype.name = function() {
.replace('no-', '');
};
/**
* Return option name, in a camelcase format that can be used
* as a object attribute key.
*
* @return {String}
* @api private
*/
Option.prototype.attributeName = function() {
return camelcase( this.name() );
};
/**
* Check if `arg` matches the short or long flag.
*
......@@ -156,6 +167,10 @@ Command.prototype.__proto__ = EventEmitter.prototype;
*/
Command.prototype.command = function(name, desc, opts) {
if(typeof desc === 'object' && desc !== null){
opts = desc;
desc = null;
}
opts = opts || {};
var args = name.split(/ +/);
var cmd = new Command(args.shift());
......@@ -166,7 +181,6 @@ Command.prototype.command = function(name, desc, opts) {
this._execs[cmd._name] = true;
if (opts.isDefault) this.defaultExecutable = cmd._name;
}
cmd._noHelp = !!opts.noHelp;
this.commands.push(cmd);
cmd.parseExpectedArgs(args);
......@@ -302,8 +316,8 @@ Command.prototype.action = function(fn) {
};
var parent = this.parent || this;
var name = parent === this ? '*' : this._name;
parent.on(name, listener);
if (this._alias) parent.on(this._alias, listener);
parent.on('command:' + name, listener);
if (this._alias) parent.on('command:' + this._alias, listener);
return this;
};
......@@ -350,8 +364,8 @@ Command.prototype.action = function(fn) {
*
* @param {String} flags
* @param {String} description
* @param {Function|Mixed} fn or default
* @param {Mixed} defaultValue
* @param {Function|*} [fn] or default
* @param {*} [defaultValue]
* @return {Command} for chaining
* @api public
*/
......@@ -360,7 +374,7 @@ Command.prototype.option = function(flags, description, fn, defaultValue) {
var self = this
, option = new Option(flags, description)
, oname = option.name()
, name = camelcase(oname);
, name = option.attributeName();
// default as 3rd arg
if (typeof fn != 'function') {
......@@ -382,7 +396,10 @@ Command.prototype.option = function(flags, description, fn, defaultValue) {
// when --no-* we make sure default is true
if (false == option.bool) defaultValue = true;
// preassign only if we have a default
if (undefined !== defaultValue) self[name] = defaultValue;
if (undefined !== defaultValue) {
self[name] = defaultValue;
option.defaultValue = defaultValue;
}
}
// register the option
......@@ -390,7 +407,7 @@ Command.prototype.option = function(flags, description, fn, defaultValue) {
// when it's passed assign the value
// and conditionally invoke the callback
this.on(oname, function(val) {
this.on('option:' + oname, function(val) {
// coercion
if (null !== val && fn) val = fn(val, undefined === self[name]
? defaultValue
......@@ -459,11 +476,24 @@ Command.prototype.parse = function(argv) {
// executable sub-commands
var name = result.args[0];
var aliasCommand = null;
// check alias of sub commands
if (name) {
aliasCommand = this.commands.filter(function(command) {
return command.alias() === name;
})[0];
}
if (this._execs[name] && typeof this._execs[name] != "function") {
return this.executeSubCommand(argv, args, parsed.unknown);
} else if (aliasCommand) {
// is alias of a subCommand
args[0] = aliasCommand._name;
return this.executeSubCommand(argv, args, parsed.unknown);
} else if (this.defaultExecutable) {
// use the default subcommand
args.unshift(name = this.defaultExecutable);
args.unshift(this.defaultExecutable);
return this.executeSubCommand(argv, args, parsed.unknown);
}
......@@ -500,7 +530,7 @@ Command.prototype.executeSubCommand = function(argv, args, unknown) {
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir
, link = readlink(f);
, link = fs.lstatSync(f).isSymbolicLink() ? fs.readlinkSync(f) : f;
// when symbolink is relative path
if (link !== f && link.charAt(0) !== '/') {
......@@ -525,19 +555,27 @@ Command.prototype.executeSubCommand = function(argv, args, unknown) {
var proc;
if (process.platform !== 'win32') {
if (isExplicitJS) {
args.unshift(localBin);
args.unshift(bin);
// add executable arguments to spawn
args = (process.execArgv || []).concat(args);
proc = spawn('node', args, { stdio: 'inherit', customFds: [0, 1, 2] });
proc = spawn(process.argv[0], args, { stdio: 'inherit', customFds: [0, 1, 2] });
} else {
proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });
}
} else {
args.unshift(localBin);
args.unshift(bin);
proc = spawn(process.execPath, args, { stdio: 'inherit'});
}
var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];
signals.forEach(function(signal) {
process.on(signal, function(){
if ((proc.killed === false) && (proc.exitCode === null)){
proc.kill(signal);
}
});
});
proc.on('close', process.exit.bind(process));
proc.on('error', function(err) {
if (err.code == "ENOENT") {
......@@ -611,10 +649,10 @@ Command.prototype.parseArgs = function(args, unknown) {
if (args.length) {
name = args[0];
if (this.listeners(name).length) {
this.emit(args.shift(), args, unknown);
if (this.listeners('command:' + name).length) {
this.emit('command:' + args.shift(), args, unknown);
} else {
this.emit('*', args);
this.emit('command:*', args);
}
} else {