passenger 5.0.21 → 5.0.22
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- checksums.yaml +8 -8
- checksums.yaml.gz.asc +7 -7
- data.tar.gz.asc +7 -7
- data/CHANGELOG +38 -2
- data/CONTRIBUTORS +3 -0
- data/README.md +5 -1
- data/bin/passenger-status +2 -7
- data/build/agent.rb +2 -0
- data/build/cxx_dependency_map.rb +1464 -162
- data/build/node_tests.rb +1 -1
- data/build/packaging.rb +1 -1
- data/dev/ci/run_travis.sh +1 -1
- data/dev/vagrant/provision.sh +1 -1
- data/npm-shrinkwrap.json +635 -125
- data/package.json +1 -1
- data/resources/templates/standalone/config.erb +33 -161
- data/resources/templates/standalone/global.erb +15 -0
- data/resources/templates/standalone/http.erb +40 -0
- data/resources/templates/standalone/mass_deployment_default_server.erb +11 -0
- data/resources/templates/standalone/rails_asset_pipeline.erb +22 -0
- data/resources/templates/standalone/server.erb +58 -0
- data/src/agent/Core/ApiServer.h +37 -32
- data/src/agent/Core/ApplicationPool/BasicGroupInfo.h +1 -1
- data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +6 -0
- data/src/agent/Core/ApplicationPool/Common.h +1 -1
- data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +4 -0
- data/src/agent/Core/ApplicationPool/Implementation.cpp +2 -2
- data/src/agent/Core/ApplicationPool/Options.h +18 -1
- data/src/agent/Core/ApplicationPool/Pool.h +1 -1
- data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +6 -6
- data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +3 -3
- data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +6 -0
- data/src/agent/Core/ApplicationPool/Process.h +6 -1
- data/src/agent/Core/ApplicationPool/Socket.h +9 -12
- data/src/agent/Core/Controller.h +422 -0
- data/src/agent/Core/{RequestHandler → Controller}/AppResponse.h +2 -0
- data/src/agent/Core/{RequestHandler → Controller}/BufferBody.cpp +27 -5
- data/src/agent/Core/{RequestHandler → Controller}/CheckoutSession.cpp +61 -31
- data/src/agent/Core/{RequestHandler → Controller}/Client.h +5 -2
- data/src/agent/Core/{RequestHandler → Controller}/ForwardResponse.cpp +93 -42
- data/src/agent/Core/{RequestHandler → Controller}/Hooks.cpp +107 -60
- data/src/agent/Core/Controller/Implementation.cpp +38 -0
- data/src/agent/Core/{RequestHandler → Controller}/InitRequest.cpp +134 -80
- data/src/agent/Core/Controller/InitializationAndShutdown.cpp +165 -0
- data/src/agent/Core/{RequestHandler/Utils.cpp → Controller/InternalUtils.cpp} +49 -32
- data/src/agent/Core/Controller/Miscellaneous.cpp +116 -0
- data/src/agent/Core/{RequestHandler → Controller}/Request.h +6 -4
- data/src/agent/Core/{RequestHandler → Controller}/SendRequest.cpp +205 -130
- data/src/agent/Core/Controller/StateInspectionAndConfiguration.cpp +161 -0
- data/src/agent/Core/{RequestHandler → Controller}/TurboCaching.h +3 -0
- data/src/agent/Core/CoreMain.cpp +62 -51
- data/src/agent/Core/OptionParser.h +24 -0
- data/src/agent/Core/ResponseCache.h +5 -5
- data/src/agent/Core/SpawningKit/Config.h +2 -2
- data/src/agent/Core/SpawningKit/SmartSpawner.h +1 -1
- data/src/agent/Core/UnionStation/{Core.h → Context.h} +14 -18
- data/src/agent/Core/UnionStation/StopwatchLog.h +3 -2
- data/src/agent/Core/UnionStation/Transaction.h +7 -7
- data/src/agent/Shared/ApiServerUtils.h +9 -1
- data/src/agent/UstRouter/ApiServer.h +5 -2
- data/src/agent/UstRouter/Controller.h +27 -9
- data/src/agent/UstRouter/UstRouterMain.cpp +1 -0
- data/src/agent/Watchdog/ApiServer.h +5 -2
- data/src/apache2_module/ConfigurationCommands.cpp +7 -0
- data/src/apache2_module/ConfigurationFields.hpp +2 -0
- data/src/apache2_module/ConfigurationSetters.cpp +24 -0
- data/src/apache2_module/CreateDirConfig.cpp +1 -0
- data/src/apache2_module/Hooks.cpp +6 -5
- data/src/apache2_module/MergeDirConfig.cpp +7 -0
- data/src/apache2_module/SetHeaders.cpp +5 -0
- data/src/cxx_supportlib/Constants.h +5 -3
- data/src/cxx_supportlib/SafeLibev.h +2 -1
- data/src/cxx_supportlib/UnionStationFilterSupport.h +2 -1
- data/src/cxx_supportlib/Utils/ReleaseableScopedPointer.h +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/libs/regex/src/regex_raw_buffer.cpp +6 -6
- data/src/helper-scripts/node-loader.js +59 -0
- data/src/nginx_module/CacheLocationConfig.c +48 -0
- data/src/nginx_module/ConfigurationCommands.c +20 -0
- data/src/nginx_module/ConfigurationFields.h +4 -0
- data/src/nginx_module/CreateLocationConfig.c +8 -0
- data/src/nginx_module/MergeLocationConfig.c +12 -0
- data/src/nodejs_supportlib/phusion_passenger/log_express.js +106 -0
- data/src/nodejs_supportlib/phusion_passenger/log_mongodb.js +203 -0
- data/src/nodejs_supportlib/phusion_passenger/ustreporter.js +227 -0
- data/src/nodejs_supportlib/phusion_passenger/ustrouter_connector.js +446 -0
- data/src/nodejs_supportlib/vendor-copy/codify/codify.js +44 -0
- data/src/nodejs_supportlib/vendor-copy/codify/package.json +29 -0
- data/src/nodejs_supportlib/vendor-copy/continuation-local-storage/context.js +200 -0
- data/src/nodejs_supportlib/vendor-copy/continuation-local-storage/node_modules/async-listener/glue.js +488 -0
- data/src/nodejs_supportlib/vendor-copy/continuation-local-storage/node_modules/async-listener/index.js +407 -0
- data/src/nodejs_supportlib/vendor-copy/continuation-local-storage/node_modules/async-listener/node_modules/shimmer/index.js +90 -0
- data/src/nodejs_supportlib/vendor-copy/continuation-local-storage/node_modules/async-listener/node_modules/shimmer/package.json +40 -0
- data/src/nodejs_supportlib/vendor-copy/continuation-local-storage/node_modules/async-listener/package.json +54 -0
- data/src/nodejs_supportlib/vendor-copy/continuation-local-storage/node_modules/emitter-listener/listener.js +160 -0
- data/src/nodejs_supportlib/vendor-copy/continuation-local-storage/node_modules/emitter-listener/node_modules/shimmer/index.js +90 -0
- data/src/nodejs_supportlib/vendor-copy/continuation-local-storage/node_modules/emitter-listener/node_modules/shimmer/package.json +40 -0
- data/src/nodejs_supportlib/vendor-copy/continuation-local-storage/node_modules/emitter-listener/package.json +46 -0
- data/src/nodejs_supportlib/vendor-copy/continuation-local-storage/package.json +56 -0
- data/src/nodejs_supportlib/vendor-copy/network-byte-order/lib/index.js +102 -0
- data/src/nodejs_supportlib/vendor-copy/network-byte-order/package.json +51 -0
- data/src/nodejs_supportlib/vendor-copy/winston/LICENSE +19 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston.js +165 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/common.js +483 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/config.js +62 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/config/cli-config.js +35 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/config/npm-config.js +27 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/config/syslog-config.js +31 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/container.js +127 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/exception.js +56 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/logger.js +701 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/transports.js +34 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/transports/console.js +128 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/transports/daily-rotate-file.js +601 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/transports/file.js +675 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/transports/http.js +232 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/transports/memory.js +89 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/transports/transport.js +135 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/transports/webhook.js +146 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/async/LICENSE +19 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/async/lib/async.js +1283 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/async/package.json +66 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/async/support/sync-package-managers.js +53 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/MIT-LICENSE.txt +23 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/colors.js +176 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/custom/trap.js +45 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/custom/zalgo.js +104 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/extendStringPrototype.js +118 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/index.js +12 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/maps/america.js +12 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/maps/rainbow.js +13 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/maps/random.js +8 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/maps/zebra.js +5 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/styles.js +77 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/system/supports-colors.js +61 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/package.json +35 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/safe.js +9 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/themes/generic-logging.js +12 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/cycle/cycle.js +170 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/cycle/package.json +30 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/eyes/LICENSE +20 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/eyes/lib/eyes.js +236 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/eyes/package.json +42 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/isstream/LICENSE.md +11 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/isstream/isstream.js +27 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/isstream/package.json +42 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/pkginfo/LICENSE +19 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/pkginfo/lib/pkginfo.js +136 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/pkginfo/package.json +56 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/stack-trace/License +19 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/stack-trace/lib/stack-trace.js +111 -0
- data/src/nodejs_supportlib/vendor-copy/winston/node_modules/stack-trace/package.json +33 -0
- data/src/nodejs_supportlib/vendor-copy/winston/package.json +87 -0
- data/src/ruby_supportlib/phusion_passenger.rb +3 -4
- data/src/ruby_supportlib/phusion_passenger/admin_tools/instance.rb +19 -2
- data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +8 -0
- data/src/ruby_supportlib/phusion_passenger/config/list_instances_command.rb +2 -6
- data/src/ruby_supportlib/phusion_passenger/config/reopen_logs_command.rb +13 -0
- data/src/ruby_supportlib/phusion_passenger/config/restart_app_command.rb +3 -0
- data/src/ruby_supportlib/phusion_passenger/config/utils.rb +9 -7
- data/src/ruby_supportlib/phusion_passenger/config/validate_install_command.rb +8 -1
- data/src/ruby_supportlib/phusion_passenger/constants.rb +3 -1
- data/src/ruby_supportlib/phusion_passenger/native_support.rb +20 -4
- data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +8 -0
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache_detector.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +11 -4
- data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +647 -0
- data/src/ruby_supportlib/phusion_passenger/standalone/config_utils.rb +229 -15
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +35 -323
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +36 -12
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +123 -14
- data/src/ruby_supportlib/phusion_passenger/standalone/status_command.rb +32 -17
- data/src/ruby_supportlib/phusion_passenger/standalone/stop_command.rb +32 -21
- data/src/ruby_supportlib/phusion_passenger/standalone/version_command.rb +5 -5
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/README.md +2 -2
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/Rakefile +5 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core.rb +68 -24
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/api.rb +9 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/context.rb +9 -7
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter.rb +3 -2
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/basics.rb +8 -5
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/simple_json.rb +395 -0
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/transaction.rb +10 -7
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/utils.rb +14 -0
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/version_data.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml +4 -2
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.example +2 -2
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.travis +2 -2
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.travis-with-sudo +16 -0
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/Gemfile +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/Gemfile.lock +2 -2
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/README.md +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails.rb +44 -17
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/active_support_cache_subscriber.rb +16 -7
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/version_data.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/union_station_hooks_rails.gemspec +1 -1
- metadata +99 -16
- metadata.gz.asc +7 -7
- data/resources/oss-binaries.phusionpassenger.com.crt +0 -248
- data/src/agent/Core/RequestHandler.h +0 -471
data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/extendStringPrototype.js
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
var colors = require('./colors'),
|
2
|
+
styles = require('./styles');
|
3
|
+
|
4
|
+
module['exports'] = function () {
|
5
|
+
|
6
|
+
//
|
7
|
+
// Extends prototype of native string object to allow for "foo".red syntax
|
8
|
+
//
|
9
|
+
var addProperty = function (color, func) {
|
10
|
+
String.prototype.__defineGetter__(color, func);
|
11
|
+
};
|
12
|
+
|
13
|
+
var sequencer = function sequencer (map, str) {
|
14
|
+
return function () {
|
15
|
+
var exploded = this.split(""), i = 0;
|
16
|
+
exploded = exploded.map(map);
|
17
|
+
return exploded.join("");
|
18
|
+
}
|
19
|
+
};
|
20
|
+
|
21
|
+
var stylize = function stylize (str, style) {
|
22
|
+
return styles[style].open + str + styles[style].close;
|
23
|
+
}
|
24
|
+
|
25
|
+
addProperty('strip', function () {
|
26
|
+
return colors.strip(this);
|
27
|
+
});
|
28
|
+
|
29
|
+
addProperty('stripColors', function () {
|
30
|
+
return colors.strip(this);
|
31
|
+
});
|
32
|
+
|
33
|
+
addProperty("trap", function(){
|
34
|
+
return colors.trap(this);
|
35
|
+
});
|
36
|
+
|
37
|
+
addProperty("zalgo", function(){
|
38
|
+
return colors.zalgo(this);
|
39
|
+
});
|
40
|
+
|
41
|
+
addProperty("zebra", function(){
|
42
|
+
return colors.zebra(this);
|
43
|
+
});
|
44
|
+
|
45
|
+
addProperty("rainbow", function(){
|
46
|
+
return colors.rainbow(this);
|
47
|
+
});
|
48
|
+
|
49
|
+
addProperty("random", function(){
|
50
|
+
return colors.random(this);
|
51
|
+
});
|
52
|
+
|
53
|
+
addProperty("america", function(){
|
54
|
+
return colors.america(this);
|
55
|
+
});
|
56
|
+
|
57
|
+
//
|
58
|
+
// Iterate through all default styles and colors
|
59
|
+
//
|
60
|
+
var x = Object.keys(colors.styles);
|
61
|
+
x.forEach(function (style) {
|
62
|
+
addProperty(style, function () {
|
63
|
+
return stylize(this, style);
|
64
|
+
});
|
65
|
+
});
|
66
|
+
|
67
|
+
function applyTheme(theme) {
|
68
|
+
//
|
69
|
+
// Remark: This is a list of methods that exist
|
70
|
+
// on String that you should not overwrite.
|
71
|
+
//
|
72
|
+
var stringPrototypeBlacklist = [
|
73
|
+
'__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor',
|
74
|
+
'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt',
|
75
|
+
'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring',
|
76
|
+
'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight'
|
77
|
+
];
|
78
|
+
|
79
|
+
Object.keys(theme).forEach(function (prop) {
|
80
|
+
if (stringPrototypeBlacklist.indexOf(prop) !== -1) {
|
81
|
+
console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name');
|
82
|
+
}
|
83
|
+
else {
|
84
|
+
if (typeof(theme[prop]) === 'string') {
|
85
|
+
colors[prop] = colors[theme[prop]];
|
86
|
+
addProperty(prop, function () {
|
87
|
+
return colors[theme[prop]](this);
|
88
|
+
});
|
89
|
+
}
|
90
|
+
else {
|
91
|
+
addProperty(prop, function () {
|
92
|
+
var ret = this;
|
93
|
+
for (var t = 0; t < theme[prop].length; t++) {
|
94
|
+
ret = exports[theme[prop][t]](ret);
|
95
|
+
}
|
96
|
+
return ret;
|
97
|
+
});
|
98
|
+
}
|
99
|
+
}
|
100
|
+
});
|
101
|
+
}
|
102
|
+
|
103
|
+
colors.setTheme = function (theme) {
|
104
|
+
if (typeof theme === 'string') {
|
105
|
+
try {
|
106
|
+
colors.themes[theme] = require(theme);
|
107
|
+
applyTheme(colors.themes[theme]);
|
108
|
+
return colors.themes[theme];
|
109
|
+
} catch (err) {
|
110
|
+
console.log(err);
|
111
|
+
return err;
|
112
|
+
}
|
113
|
+
} else {
|
114
|
+
applyTheme(theme);
|
115
|
+
}
|
116
|
+
};
|
117
|
+
|
118
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
var colors = require('./colors');
|
2
|
+
module['exports'] = colors;
|
3
|
+
|
4
|
+
// Remark: By default, colors will add style properties to String.prototype
|
5
|
+
//
|
6
|
+
// If you don't wish to extend String.prototype you can do this instead and native String will not be touched
|
7
|
+
//
|
8
|
+
// var colors = require('colors/safe);
|
9
|
+
// colors.red("foo")
|
10
|
+
//
|
11
|
+
//
|
12
|
+
var extendStringPrototype = require('./extendStringPrototype')();
|
@@ -0,0 +1,12 @@
|
|
1
|
+
var colors = require('../colors');
|
2
|
+
|
3
|
+
module['exports'] = (function() {
|
4
|
+
return function (letter, i, exploded) {
|
5
|
+
if(letter === " ") return letter;
|
6
|
+
switch(i%3) {
|
7
|
+
case 0: return colors.red(letter);
|
8
|
+
case 1: return colors.white(letter)
|
9
|
+
case 2: return colors.blue(letter)
|
10
|
+
}
|
11
|
+
}
|
12
|
+
})();
|
@@ -0,0 +1,13 @@
|
|
1
|
+
var colors = require('../colors');
|
2
|
+
|
3
|
+
module['exports'] = (function () {
|
4
|
+
var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV
|
5
|
+
return function (letter, i, exploded) {
|
6
|
+
if (letter === " ") {
|
7
|
+
return letter;
|
8
|
+
} else {
|
9
|
+
return colors[rainbowColors[i++ % rainbowColors.length]](letter);
|
10
|
+
}
|
11
|
+
};
|
12
|
+
})();
|
13
|
+
|
@@ -0,0 +1,8 @@
|
|
1
|
+
var colors = require('../colors');
|
2
|
+
|
3
|
+
module['exports'] = (function () {
|
4
|
+
var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
|
5
|
+
return function(letter, i, exploded) {
|
6
|
+
return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 1))]](letter);
|
7
|
+
};
|
8
|
+
})();
|
@@ -0,0 +1,77 @@
|
|
1
|
+
/*
|
2
|
+
The MIT License (MIT)
|
3
|
+
|
4
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
14
|
+
all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
THE SOFTWARE.
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
var styles = {};
|
27
|
+
module['exports'] = styles;
|
28
|
+
|
29
|
+
var codes = {
|
30
|
+
reset: [0, 0],
|
31
|
+
|
32
|
+
bold: [1, 22],
|
33
|
+
dim: [2, 22],
|
34
|
+
italic: [3, 23],
|
35
|
+
underline: [4, 24],
|
36
|
+
inverse: [7, 27],
|
37
|
+
hidden: [8, 28],
|
38
|
+
strikethrough: [9, 29],
|
39
|
+
|
40
|
+
black: [30, 39],
|
41
|
+
red: [31, 39],
|
42
|
+
green: [32, 39],
|
43
|
+
yellow: [33, 39],
|
44
|
+
blue: [34, 39],
|
45
|
+
magenta: [35, 39],
|
46
|
+
cyan: [36, 39],
|
47
|
+
white: [37, 39],
|
48
|
+
gray: [90, 39],
|
49
|
+
grey: [90, 39],
|
50
|
+
|
51
|
+
bgBlack: [40, 49],
|
52
|
+
bgRed: [41, 49],
|
53
|
+
bgGreen: [42, 49],
|
54
|
+
bgYellow: [43, 49],
|
55
|
+
bgBlue: [44, 49],
|
56
|
+
bgMagenta: [45, 49],
|
57
|
+
bgCyan: [46, 49],
|
58
|
+
bgWhite: [47, 49],
|
59
|
+
|
60
|
+
// legacy styles for colors pre v1.0.0
|
61
|
+
blackBG: [40, 49],
|
62
|
+
redBG: [41, 49],
|
63
|
+
greenBG: [42, 49],
|
64
|
+
yellowBG: [43, 49],
|
65
|
+
blueBG: [44, 49],
|
66
|
+
magentaBG: [45, 49],
|
67
|
+
cyanBG: [46, 49],
|
68
|
+
whiteBG: [47, 49]
|
69
|
+
|
70
|
+
};
|
71
|
+
|
72
|
+
Object.keys(codes).forEach(function (key) {
|
73
|
+
var val = codes[key];
|
74
|
+
var style = styles[key] = [];
|
75
|
+
style.open = '\u001b[' + val[0] + 'm';
|
76
|
+
style.close = '\u001b[' + val[1] + 'm';
|
77
|
+
});
|
data/src/nodejs_supportlib/vendor-copy/winston/node_modules/colors/lib/system/supports-colors.js
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
/*
|
2
|
+
The MIT License (MIT)
|
3
|
+
|
4
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
14
|
+
all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
THE SOFTWARE.
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
var argv = process.argv;
|
27
|
+
|
28
|
+
module.exports = (function () {
|
29
|
+
if (argv.indexOf('--no-color') !== -1 ||
|
30
|
+
argv.indexOf('--color=false') !== -1) {
|
31
|
+
return false;
|
32
|
+
}
|
33
|
+
|
34
|
+
if (argv.indexOf('--color') !== -1 ||
|
35
|
+
argv.indexOf('--color=true') !== -1 ||
|
36
|
+
argv.indexOf('--color=always') !== -1) {
|
37
|
+
return true;
|
38
|
+
}
|
39
|
+
|
40
|
+
if (process.stdout && !process.stdout.isTTY) {
|
41
|
+
return false;
|
42
|
+
}
|
43
|
+
|
44
|
+
if (process.platform === 'win32') {
|
45
|
+
return true;
|
46
|
+
}
|
47
|
+
|
48
|
+
if ('COLORTERM' in process.env) {
|
49
|
+
return true;
|
50
|
+
}
|
51
|
+
|
52
|
+
if (process.env.TERM === 'dumb') {
|
53
|
+
return false;
|
54
|
+
}
|
55
|
+
|
56
|
+
if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
|
57
|
+
return true;
|
58
|
+
}
|
59
|
+
|
60
|
+
return false;
|
61
|
+
})();
|
@@ -0,0 +1,35 @@
|
|
1
|
+
{
|
2
|
+
"name": "colors",
|
3
|
+
"description": "get colors in your node.js console",
|
4
|
+
"version": "1.0.3",
|
5
|
+
"author": {
|
6
|
+
"name": "Marak Squires"
|
7
|
+
},
|
8
|
+
"homepage": "https://github.com/Marak/colors.js",
|
9
|
+
"bugs": {
|
10
|
+
"url": "https://github.com/Marak/colors.js/issues"
|
11
|
+
},
|
12
|
+
"keywords": [
|
13
|
+
"ansi",
|
14
|
+
"terminal",
|
15
|
+
"colors"
|
16
|
+
],
|
17
|
+
"repository": {
|
18
|
+
"type": "git",
|
19
|
+
"url": "git+ssh://git@github.com/Marak/colors.js.git"
|
20
|
+
},
|
21
|
+
"license": "MIT",
|
22
|
+
"scripts": {
|
23
|
+
"test": "node tests/basic-test.js && node tests/safe-test.js"
|
24
|
+
},
|
25
|
+
"engines": {
|
26
|
+
"node": ">=0.1.90"
|
27
|
+
},
|
28
|
+
"main": "./lib/index",
|
29
|
+
"readme": "# colors.js\n\n## get color and style in your node.js console\n\n<img src=\"https://github.com/Marak/colors.js/raw/master/screenshots/colors.png\"/>\n\n## Installation\n\n npm install colors\n\n## colors and styles!\n\n### text colors\n\n - black\n - red\n - green\n - yellow\n - blue\n - magenta\n - cyan\n - white\n - gray\n - grey\n\n### background colors\n\n\n\n - bgBlack\n - bgRed\n - bgGreen\n - bgYellow\n - bgBlue\n - bgMagenta\n - bgCyan\n - bgWhite\n\n### styles\n\n - reset\n - bold\n - dim\n - italic\n - underline\n - inverse\n - hidden\n - strikethrough\n\n### extras\n\n - rainbow\n - zebra\n - america\n - trap\n - random\n\n\n## Usage\n\nBy popular demand, `colors` now ships with two types of usages!\n\nThe super nifty way\n\n```js\nvar colors = require('colors');\n\nconsole.log('hello'.green); // outputs green text\nconsole.log('i like cake and pies'.underline.red) // outputs red underlined text\nconsole.log('inverse the color'.inverse); // inverses the color\nconsole.log('OMG Rainbows!'.rainbow); // rainbow\nconsole.log('Run the trap'.trap); // Drops the bass\n\n```\n\nor a slightly less nifty way which doesn't extend `String.prototype`\n\n```js\nvar colors = require('colors/safe');\n\nconsole.log(colors.green('hello')); // outputs green text\nconsole.log(colors.red.underline('i like cake and pies')) // outputs red underlined text\nconsole.log(colors.inverse('inverse the color')); // inverses the color\nconsole.log(colors.rainbow('OMG Rainbows!')); // rainbow\nconsole.log(colors.trap('Run the trap')); // Drops the bass\n\n```\n\nI prefer the first way. Some people seem to be afraid of extending `String.prototype` and prefer the second way. \n\nIf you are writing good code you will never have an issue with the first approach. If you really don't want to touch `String.prototype`, the second usage will not touch `String` native object.\n\n## Disabling Colors\n\nTo disable colors you can pass the following arguments in the command line to your application:\n\n```bash\nnode myapp.js --no-color\n```\n\n## Console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data)\n\n```js\nvar name = 'Marak';\nconsole.log(colors.green('Hello %s'), name);\n// outputs -> 'Hello Marak'\n```\n\n## Custom themes\n\n### Using standard API\n\n```js\n\nvar colors = require('colors');\n\ncolors.setTheme({\n silly: 'rainbow',\n input: 'grey',\n verbose: 'cyan',\n prompt: 'grey',\n info: 'green',\n data: 'grey',\n help: 'cyan',\n warn: 'yellow',\n debug: 'blue',\n error: 'red'\n});\n\n// outputs red text\nconsole.log(\"this is an error\".error);\n\n// outputs yellow text\nconsole.log(\"this is a warning\".warn);\n```\n\n### Using string safe API\n\n```js\nvar colors = require('colors/safe');\n\n// set single property\nvar error = colors.red;\nerror('this is red');\n\n// set theme\ncolors.setTheme({\n silly: 'rainbow',\n input: 'grey',\n verbose: 'cyan',\n prompt: 'grey',\n info: 'green',\n data: 'grey',\n help: 'cyan',\n warn: 'yellow',\n debug: 'blue',\n error: 'red'\n});\n\n// outputs red text\nconsole.log(colors.error(\"this is an error\"));\n\n// outputs yellow text\nconsole.log(colors.warn(\"this is a warning\"));\n```\n\n*Protip: There is a secret undocumented style in `colors`. If you find the style you can summon him.*",
|
30
|
+
"readmeFilename": "ReadMe.md",
|
31
|
+
"_id": "colors@1.0.3",
|
32
|
+
"_shasum": "0433f44d809680fdeb60ed260f1b0c262e82a40b",
|
33
|
+
"_from": "colors@1.0.x",
|
34
|
+
"_resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz"
|
35
|
+
}
|
@@ -0,0 +1,170 @@
|
|
1
|
+
/*
|
2
|
+
cycle.js
|
3
|
+
2013-02-19
|
4
|
+
|
5
|
+
Public Domain.
|
6
|
+
|
7
|
+
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
8
|
+
|
9
|
+
This code should be minified before deployment.
|
10
|
+
See http://javascript.crockford.com/jsmin.html
|
11
|
+
|
12
|
+
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
|
13
|
+
NOT CONTROL.
|
14
|
+
*/
|
15
|
+
|
16
|
+
/*jslint evil: true, regexp: true */
|
17
|
+
|
18
|
+
/*members $ref, apply, call, decycle, hasOwnProperty, length, prototype, push,
|
19
|
+
retrocycle, stringify, test, toString
|
20
|
+
*/
|
21
|
+
|
22
|
+
var cycle = exports;
|
23
|
+
|
24
|
+
cycle.decycle = function decycle(object) {
|
25
|
+
'use strict';
|
26
|
+
|
27
|
+
// Make a deep copy of an object or array, assuring that there is at most
|
28
|
+
// one instance of each object or array in the resulting structure. The
|
29
|
+
// duplicate references (which might be forming cycles) are replaced with
|
30
|
+
// an object of the form
|
31
|
+
// {$ref: PATH}
|
32
|
+
// where the PATH is a JSONPath string that locates the first occurance.
|
33
|
+
// So,
|
34
|
+
// var a = [];
|
35
|
+
// a[0] = a;
|
36
|
+
// return JSON.stringify(JSON.decycle(a));
|
37
|
+
// produces the string '[{"$ref":"$"}]'.
|
38
|
+
|
39
|
+
// JSONPath is used to locate the unique object. $ indicates the top level of
|
40
|
+
// the object or array. [NUMBER] or [STRING] indicates a child member or
|
41
|
+
// property.
|
42
|
+
|
43
|
+
var objects = [], // Keep a reference to each unique object or array
|
44
|
+
paths = []; // Keep the path to each unique object or array
|
45
|
+
|
46
|
+
return (function derez(value, path) {
|
47
|
+
|
48
|
+
// The derez recurses through the object, producing the deep copy.
|
49
|
+
|
50
|
+
var i, // The loop counter
|
51
|
+
name, // Property name
|
52
|
+
nu; // The new object or array
|
53
|
+
|
54
|
+
// typeof null === 'object', so go on if this value is really an object but not
|
55
|
+
// one of the weird builtin objects.
|
56
|
+
|
57
|
+
if (typeof value === 'object' && value !== null &&
|
58
|
+
!(value instanceof Boolean) &&
|
59
|
+
!(value instanceof Date) &&
|
60
|
+
!(value instanceof Number) &&
|
61
|
+
!(value instanceof RegExp) &&
|
62
|
+
!(value instanceof String)) {
|
63
|
+
|
64
|
+
// If the value is an object or array, look to see if we have already
|
65
|
+
// encountered it. If so, return a $ref/path object. This is a hard way,
|
66
|
+
// linear search that will get slower as the number of unique objects grows.
|
67
|
+
|
68
|
+
for (i = 0; i < objects.length; i += 1) {
|
69
|
+
if (objects[i] === value) {
|
70
|
+
return {$ref: paths[i]};
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
// Otherwise, accumulate the unique value and its path.
|
75
|
+
|
76
|
+
objects.push(value);
|
77
|
+
paths.push(path);
|
78
|
+
|
79
|
+
// If it is an array, replicate the array.
|
80
|
+
|
81
|
+
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
82
|
+
nu = [];
|
83
|
+
for (i = 0; i < value.length; i += 1) {
|
84
|
+
nu[i] = derez(value[i], path + '[' + i + ']');
|
85
|
+
}
|
86
|
+
} else {
|
87
|
+
|
88
|
+
// If it is an object, replicate the object.
|
89
|
+
|
90
|
+
nu = {};
|
91
|
+
for (name in value) {
|
92
|
+
if (Object.prototype.hasOwnProperty.call(value, name)) {
|
93
|
+
nu[name] = derez(value[name],
|
94
|
+
path + '[' + JSON.stringify(name) + ']');
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
return nu;
|
99
|
+
}
|
100
|
+
return value;
|
101
|
+
}(object, '$'));
|
102
|
+
};
|
103
|
+
|
104
|
+
|
105
|
+
cycle.retrocycle = function retrocycle($) {
|
106
|
+
'use strict';
|
107
|
+
|
108
|
+
// Restore an object that was reduced by decycle. Members whose values are
|
109
|
+
// objects of the form
|
110
|
+
// {$ref: PATH}
|
111
|
+
// are replaced with references to the value found by the PATH. This will
|
112
|
+
// restore cycles. The object will be mutated.
|
113
|
+
|
114
|
+
// The eval function is used to locate the values described by a PATH. The
|
115
|
+
// root object is kept in a $ variable. A regular expression is used to
|
116
|
+
// assure that the PATH is extremely well formed. The regexp contains nested
|
117
|
+
// * quantifiers. That has been known to have extremely bad performance
|
118
|
+
// problems on some browsers for very long strings. A PATH is expected to be
|
119
|
+
// reasonably short. A PATH is allowed to belong to a very restricted subset of
|
120
|
+
// Goessner's JSONPath.
|
121
|
+
|
122
|
+
// So,
|
123
|
+
// var s = '[{"$ref":"$"}]';
|
124
|
+
// return JSON.retrocycle(JSON.parse(s));
|
125
|
+
// produces an array containing a single element which is the array itself.
|
126
|
+
|
127
|
+
var px =
|
128
|
+
/^\$(?:\[(?:\d+|\"(?:[^\\\"\u0000-\u001f]|\\([\\\"\/bfnrt]|u[0-9a-zA-Z]{4}))*\")\])*$/;
|
129
|
+
|
130
|
+
(function rez(value) {
|
131
|
+
|
132
|
+
// The rez function walks recursively through the object looking for $ref
|
133
|
+
// properties. When it finds one that has a value that is a path, then it
|
134
|
+
// replaces the $ref object with a reference to the value that is found by
|
135
|
+
// the path.
|
136
|
+
|
137
|
+
var i, item, name, path;
|
138
|
+
|
139
|
+
if (value && typeof value === 'object') {
|
140
|
+
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
141
|
+
for (i = 0; i < value.length; i += 1) {
|
142
|
+
item = value[i];
|
143
|
+
if (item && typeof item === 'object') {
|
144
|
+
path = item.$ref;
|
145
|
+
if (typeof path === 'string' && px.test(path)) {
|
146
|
+
value[i] = eval(path);
|
147
|
+
} else {
|
148
|
+
rez(item);
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
152
|
+
} else {
|
153
|
+
for (name in value) {
|
154
|
+
if (typeof value[name] === 'object') {
|
155
|
+
item = value[name];
|
156
|
+
if (item) {
|
157
|
+
path = item.$ref;
|
158
|
+
if (typeof path === 'string' && px.test(path)) {
|
159
|
+
value[name] = eval(path);
|
160
|
+
} else {
|
161
|
+
rez(item);
|
162
|
+
}
|
163
|
+
}
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}($));
|
169
|
+
return $;
|
170
|
+
};
|