alox-jason 0.0.26 → 0.0.27
Sign up to get free protection for your applications and to get access to all the features.
- metadata +2 -6
- data/aloxec/_jason +0 -134
- data/aloxec/_log4sh +0 -3842
- data/aloxec/_shflags +0 -1012
- data/aloxec/_sub +0 -60
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alox-jason
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.27
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -19,11 +19,7 @@ email:
|
|
19
19
|
executables: []
|
20
20
|
extensions: []
|
21
21
|
extra_rdoc_files: []
|
22
|
-
files:
|
23
|
-
- aloxec/_jason
|
24
|
-
- aloxec/_log4sh
|
25
|
-
- aloxec/_shflags
|
26
|
-
- aloxec/_sub
|
22
|
+
files: []
|
27
23
|
homepage: https://github.com/destructuring/jason
|
28
24
|
licenses: []
|
29
25
|
post_install_message:
|
data/aloxec/_jason
DELETED
@@ -1,134 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
function check_help {
|
4
|
-
# taken from shocco
|
5
|
-
if expr -- "$*" : ".*--help" >/dev/null; then
|
6
|
-
display_help
|
7
|
-
exit 0
|
8
|
-
fi
|
9
|
-
}
|
10
|
-
|
11
|
-
function require {
|
12
|
-
source "$@"
|
13
|
-
}
|
14
|
-
|
15
|
-
function parse_command_line {
|
16
|
-
if [[ "$FLAGS_SUB" = "$FLAGS_TRUE" && "$@" > 0 ]]; then
|
17
|
-
export POSIXLY_CORRECT=1
|
18
|
-
fi
|
19
|
-
|
20
|
-
if ! FLAGS "$@"; then
|
21
|
-
unset POSIXLY_CORRECT
|
22
|
-
if [[ "$flags_error" = "help requested" ]]; then
|
23
|
-
echo ""
|
24
|
-
display_help
|
25
|
-
exit 0
|
26
|
-
fi
|
27
|
-
|
28
|
-
return 4
|
29
|
-
fi
|
30
|
-
|
31
|
-
unset POSIXLY_CORRECT
|
32
|
-
return 0
|
33
|
-
}
|
34
|
-
|
35
|
-
function configure_logging {
|
36
|
-
if [[ -n "${NO_LOG4SH:-}" ]]; then
|
37
|
-
return 0
|
38
|
-
fi
|
39
|
-
|
40
|
-
LOG4SH_CONFIGURATION=none require _log4sh
|
41
|
-
|
42
|
-
log4sh_resetConfiguration
|
43
|
-
|
44
|
-
# set the global logging level to INFO
|
45
|
-
logger_setLevel INFO
|
46
|
-
|
47
|
-
# add and configure a FileAppender that outputs to STDERR, and activate the
|
48
|
-
# configuration
|
49
|
-
logger_addAppender stderr
|
50
|
-
appender_setType stderr FileAppender
|
51
|
-
appender_file_setFile stderr STDERR
|
52
|
-
appender_activateOptions stderr
|
53
|
-
}
|
54
|
-
|
55
|
-
function ryaml {
|
56
|
-
ruby -ryaml -e 'def ps x; unless x.nil?; puts (x.class == String || x.class == Fixnum) ? x : x.to_yaml; end; end; ps ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[acc.class == Array ? key.to_i : (m = key.match(/^:(.*)$/); m ? m[1].to_sym : key)] }' "$@" 2>&-
|
57
|
-
}
|
58
|
-
|
59
|
-
function random_str {
|
60
|
-
echo "$(date +%s).$$.$RANDOM"
|
61
|
-
}
|
62
|
-
|
63
|
-
function runmany {
|
64
|
-
local cpu="$1"; shift
|
65
|
-
local args="$1"; shift
|
66
|
-
local cmd="$1"; shift
|
67
|
-
if [[ "$#" = 0 ]]; then
|
68
|
-
cat
|
69
|
-
else
|
70
|
-
echo "$@"
|
71
|
-
fi | xargs -P $cpu -n $args -- bash -c "$cmd" ""
|
72
|
-
}
|
73
|
-
|
74
|
-
function mark_log {
|
75
|
-
local nm_mark="$1"; shift
|
76
|
-
touch "$tmp_switch/wait-$nm_mark"
|
77
|
-
echo $tmp_switch $nm_mark
|
78
|
-
while [[ -f "$tmp_switch/wait-$nm_mark" ]]; do
|
79
|
-
sleep 1
|
80
|
-
done
|
81
|
-
}
|
82
|
-
|
83
|
-
function marked_logger {
|
84
|
-
local nm_switch=""
|
85
|
-
while read -r a b; do
|
86
|
-
if [[ "$a" = "$tmp_switch" ]]; then
|
87
|
-
nm_switch="$b"
|
88
|
-
rm "$tmp_switch/wait-$nm_switch"
|
89
|
-
else
|
90
|
-
if [[ -z "$nm_switch" ]]; then
|
91
|
-
echo "$a $b"
|
92
|
-
else
|
93
|
-
echo "$nm_switch: $a $b"
|
94
|
-
fi
|
95
|
-
fi
|
96
|
-
done
|
97
|
-
}
|
98
|
-
|
99
|
-
function mark_stdout {
|
100
|
-
if [[ -z "${tmp_switch:-}" ]]; then
|
101
|
-
tmp_switch="$(mktemp -d -t XXXXXXXXX)"
|
102
|
-
fi
|
103
|
-
exec 1> >(marked_logger)
|
104
|
-
}
|
105
|
-
|
106
|
-
function mark_stderr {
|
107
|
-
if [[ -z "${tmp_switch:-}" ]]; then
|
108
|
-
tmp_switch="$(mktemp -d -t XXXXXXXXX)"
|
109
|
-
fi
|
110
|
-
exec 2> >(marked_logger)
|
111
|
-
}
|
112
|
-
|
113
|
-
function mark_output {
|
114
|
-
if [[ -z "${tmp_switch:-}" ]]; then
|
115
|
-
tmp_switch="$(mktemp -d -t XXXXXXXXX)"
|
116
|
-
fi
|
117
|
-
exec 1> >(marked_logger) 2>&1
|
118
|
-
}
|
119
|
-
|
120
|
-
function _main {
|
121
|
-
: ${__jason__:=x}
|
122
|
-
if [[ "$__jason__" != 'x' ]]; then
|
123
|
-
return 0
|
124
|
-
fi
|
125
|
-
|
126
|
-
__jason__='y'
|
127
|
-
|
128
|
-
require _shflags
|
129
|
-
|
130
|
-
configure_logging
|
131
|
-
}
|
132
|
-
|
133
|
-
_main "$@"
|
134
|
-
set -fue
|