alox-jason 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. data/libexec/_jason +200 -0
  2. data/libexec/_log4sh +3841 -0
  3. data/libexec/_shflags +1012 -0
  4. data/libexec/_sub +60 -0
  5. metadata +51 -0
data/libexec/_sub ADDED
@@ -0,0 +1,60 @@
1
+ #!/bin/bash
2
+
3
+ if [[ "${BASH_SOURCE##*/}" != "_sub" ]]; then
4
+ shome="$(unset CDPATH; cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
5
+ source "$shome/libexec/_jason"
6
+ set -- "$BASH_SOURCE" "$@"
7
+ fi
8
+
9
+ if [[ "$(type -t main)" != "function" ]]; then
10
+ function main {
11
+ if [[ "$#" > 0 ]]; then
12
+ logger_fatal "Command $sub_base $1 not implemented"
13
+ else
14
+ logger_fatal "Command $sub_base not implemented"
15
+ fi
16
+ exit 1
17
+ }
18
+ fi
19
+
20
+ function sub {
21
+ local bsource="$1"; shift
22
+ local sub_base="$(basename "$bsource")"
23
+ local bsource_cmd="$shome/libexec/${sub_base}"
24
+
25
+ if [[ "$bsource_cmd" = "$bsource" ]]; then
26
+ FLAGS_SUB="$FLAGS_TRUE"
27
+ parse_command_line "$@" || exit $?
28
+ eval set -- "${FLAGS_ARGV}"
29
+ fi
30
+
31
+ if [[ "$#" > 0 ]]; then
32
+ if [[ ! "$1" =~ ^- ]]; then
33
+ local sub_cmd="$shome/libexec/${sub_base}-$1"
34
+
35
+ if [[ ! -x "$sub_cmd" ]]; then
36
+ sub_cmd="$(type -P "${sub_base}-$1" || true)"
37
+ fi
38
+
39
+ if [[ -x "$sub_cmd" ]]; then
40
+ shift
41
+ exec "$sub_cmd" "$@"
42
+ fi
43
+ fi
44
+ fi
45
+
46
+ if [[ -x "$bsource_cmd" && "$bsource_cmd" != "$bsource" ]]; then
47
+ exec "$bsource_cmd" "$@"
48
+ else
49
+ if [[ "$(type -t main)" = "function" ]]; then
50
+ main "$@"
51
+ else
52
+ logger_fatal "Can't run $sub_base, missing main function"
53
+ exit 1
54
+ fi
55
+ fi
56
+ }
57
+
58
+ if [[ "$#" > 0 ]]; then
59
+ sub "$@"
60
+ fi
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: alox-jason
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.21
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - David Nghiem
9
+ - Tom Bombadil
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2013-07-01 00:00:00.000000000 Z
14
+ dependencies: []
15
+ description: jason bourne again shell scripts
16
+ email:
17
+ - nghidav@gmail.com
18
+ - amanibhavam@destructuring.org
19
+ executables: []
20
+ extensions: []
21
+ extra_rdoc_files: []
22
+ files:
23
+ - libexec/_jason
24
+ - libexec/_log4sh
25
+ - libexec/_shflags
26
+ - libexec/_sub
27
+ homepage: https://github.com/destructuring/jason
28
+ licenses: []
29
+ post_install_message:
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubyforge_project:
47
+ rubygems_version: 1.8.25
48
+ signing_key:
49
+ specification_version: 3
50
+ summary: jason bourne again shell scripts
51
+ test_files: []