ghp 0.0.2 → 0.0.4

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.
@@ -1,59 +0,0 @@
1
- #!/bin/bash
2
-
3
- if [[ "${BASH_SOURCE##*/}" != "_sub" ]]; then
4
- shome="$(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="$(command -v "${sub_base}-$1" || true)"
34
- if [[ ! -x "$sub_cmd" ]]; then
35
- sub_cmd="$shome/libexec/${sub_base}-$1"
36
- fi
37
-
38
- if [[ -x "$sub_cmd" ]]; then
39
- shift
40
- exec "$sub_cmd" "$@"
41
- fi
42
- fi
43
- fi
44
-
45
- if [[ -x "$bsource_cmd" && "$bsource_cmd" != "$bsource" ]]; then
46
- exec "$bsource_cmd" "$@"
47
- else
48
- if [[ "$(type -t main)" = "function" ]]; then
49
- main "$@"
50
- else
51
- logger_fatal "Can't run $sub_base, missing main function"
52
- exit 1
53
- fi
54
- fi
55
- }
56
-
57
- if [[ "$#" > 0 ]]; then
58
- sub "$@"
59
- fi
@@ -1,30 +0,0 @@
1
- #!/bin/bash
2
-
3
- #/ NAME
4
- #/ build-gem -- upload the latest (timestamp) rubygem to rubygems.org
5
- #/
6
- #/ SYNOPSIS
7
- #/ build gem -n gem_name
8
-
9
- # figure out the project root under which bin, lib live
10
- shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
11
-
12
- # load a jason bourne library
13
- source "$shome/libexec/_jason"
14
-
15
- # define command line options:
16
- DEFINE_string 'name' "$(basename "$shome")" 'name of gem' 'n'
17
-
18
- # entry point
19
- function main {
20
- local pth_gemspec="$shome/$FLAGS_name.gemspec"
21
- if [[ ! -e "$pth_gemspec" ]]; then
22
- logger_fatal "could not find gemspec $pth_gemspec"
23
- exit 1
24
- fi
25
-
26
- cd "$shome"
27
- gem build "$pth_gemspec"
28
- }
29
-
30
- require sub "$BASH_SOURCE" "$@"
@@ -1,30 +0,0 @@
1
- #!/bin/bash
2
-
3
- #/ NAME
4
- #/ build-gem -- upload the latest (timestamp) rubygem to rubygems.org
5
- #/
6
- #/ SYNOPSIS
7
- #/ build gem -n gem_name
8
-
9
- # figure out the project root under which bin, lib live
10
- shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
11
-
12
- # load a jason bourne library
13
- source "$shome/libexec/_jason"
14
-
15
- # define command line options:
16
- DEFINE_string 'name' "$(basename "$shome")" 'name of gem' 'n'
17
-
18
- # entry point
19
- function main {
20
- local pth_gemspec="$shome/$FLAGS_name.gemspec"
21
- if [[ ! -e "$pth_gemspec" ]]; then
22
- logger_fatal "could not find gemspec $pth_gemspec"
23
- exit 1
24
- fi
25
-
26
- cd "$shome"
27
- gem build "$pth_gemspec"
28
- }
29
-
30
- require sub "$BASH_SOURCE" "$@"
@@ -1,32 +0,0 @@
1
- #!/bin/bash
2
-
3
- #/ NAME
4
- #/ bump -- increments a semver in a file or in git tags
5
- #/
6
- #/ SYNOPSIS
7
- #/ bump [major|minor|patch]
8
- #/ bump 1.2.3
9
- #/ bump
10
- #/ without arguments is equivalent to 'bump patch'
11
-
12
- # figure out the project root under which bin, lib live
13
- shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
14
-
15
- # load a jason bourne library
16
- source "$shome/libexec/_jason"
17
-
18
- # parse the command-line
19
- DEFINE_boolean 'dirty' "$FLAGS_FALSE" 'force bumping in unclean work area' 'f'
20
-
21
- # entry point
22
- function main {
23
- require 'bump'
24
-
25
- if [[ "$#" = 0 ]]; then
26
- set -- patch
27
- fi
28
-
29
- bump_version "$FLAGS_dirty" "$@"
30
- }
31
-
32
- require sub "$BASH_SOURCE" "$@"
@@ -1,81 +0,0 @@
1
- #!/bin/bash
2
-
3
- #/ NAME
4
- #/ edit-gem -- set environment to hint to Gemfile to use a local gemspec
5
- #/
6
- #/ SYNOPSIS
7
- #/ edit gem <name> [location]
8
- #/ edit gem -r <names>
9
- #/ edit gem -R
10
-
11
- # figure out the project root under which bin, lib live
12
- shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
13
-
14
- # load a jason bourne library
15
- source "$shome/libexec/_jason"
16
-
17
- # define command line options:
18
- DEFINE_boolean "update" "$FLAGS_FALSE" "finish editing a local gem and updates project" "u"
19
- DEFINE_boolean "reset" "$FLAGS_FALSE" "reset gem to remote" "r"
20
- DEFINE_boolean "resetall" "$FLAGS_FALSE" "reset all gems to remote" "R"
21
-
22
- # entry point
23
- function main {
24
- if [[ "$FLAGS_resetall" = "$FLAGS_TRUE" ]]; then
25
- set +f
26
- rm -f $shome/.local/*
27
- set -f
28
- bundle --local --quiet && bundle check > /dev/null
29
- git diff --no-ext-diff Gemfile.lock vendor/cache
30
- elif [[ "$FLAGS_reset" = "$FLAGS_TRUE" ]]; then
31
- local nm_gem
32
- for nm_gem in "$@"; do
33
- rm -f "$shome/.local/$nm_gem"
34
- done
35
-
36
- bundle --local --quiet && bundle check > /dev/null
37
-
38
- git diff --no-ext-diff Gemfile.lock vendor/cache
39
- elif [[ "$FLAGS_update" = "$FLAGS_TRUE" ]]; then
40
- local nm_gem
41
- for nm_gem in "$@"; do
42
- echo -n > "$shome/.local/$nm_gem"
43
- done
44
-
45
- bundle update "$@"
46
-
47
- for nm_gem in "$@"; do
48
- rm -f "$shome/.local/$nm_gem"
49
- done
50
- bundle --local --quiet && bundle check > /dev/null
51
-
52
- git add Gemfile.lock vendor/cache
53
- git add -u vendor/cache
54
- git diff --no-ext-diff --cached Gemfile.lock vendor/cache
55
- else
56
- local nm_gem="$1"; shift
57
-
58
- local pth_gem
59
- if [[ "$#" = 0 ]]; then
60
- pth_gem="gems/$nm_gem"
61
- else
62
- pth_gem="$1"; shift
63
- fi
64
-
65
- if [[ ! -d "$pth_gem" ]]; then
66
- logger_fatal "cannot find local gem directoy at $pth_gem"
67
- exit 1
68
- fi
69
-
70
- pth_gem="$(cd -P -- "$pth_gem" && pwd -P)"
71
-
72
- echo "enabling local gem development on ${nm_gem} at ${pth_gem}"
73
- mkdir -p "$shome/.local"
74
- echo "$pth_gem" > "$shome/.local/$nm_gem"
75
-
76
- bundle --local --quiet && bundle check > /dev/null
77
- git diff --no-ext-diff Gemfile.lock vendor/cache
78
- fi
79
- }
80
-
81
- require sub "$BASH_SOURCE" "$@"
@@ -1,58 +0,0 @@
1
- #!/bin/bash
2
-
3
- #/ NAME
4
- #/ publish-gem -- publish a gem to a local, remote rubygems, geminabox repository
5
- #/
6
- #/ SYNOPSIS
7
- #/ publish gem [--public | --private | --local]
8
-
9
- # figure out the project root under which bin, lib live
10
- shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
11
-
12
- # load a jason bourne library
13
- source "$shome/libexec/_jason"
14
-
15
- # define command line options:
16
- DEFINE_boolean "private" "$FLAGS_TRUE" "push to a local, private geminabox"
17
- DEFINE_boolean "shared" "$FLAGS_FALSE" "push to a shared, private geminabox"
18
- DEFINE_boolean "public" "$FLAGS_FALSE" "push to rubygems.org"
19
-
20
- # entry point
21
- function main {
22
- if [[ "$FLAGS_public" = "$FLAGS_TRUE" ]]; then
23
- push_gem "$@"
24
- elif [[ "$FLAGS_private" = "$FLAGS_TRUE" ]]; then
25
- push_gem_private
26
- else
27
- logger_fatal "must specify --public to confirm a gem push to rubygems.org"
28
- exit 1
29
- fi
30
- }
31
-
32
- # push a gem locally
33
- function push_gem_private {
34
- if [[ "$#" = 0 ]]; then
35
- set +f
36
- local latest_gem="$(ls -td *.gem 2>&- | head -1)"
37
- push_gem_private "$latest_gem"
38
- set -f
39
- else
40
- gem inabox -g http://localhost:9292 "$@"
41
- fi
42
- }
43
-
44
- # push the latest gem to rubygems.org
45
- function push_gem {
46
- set +f
47
- local latest_gem="$(ls -td *.gem 2>&- | head -1)"
48
- set -f
49
-
50
- if [[ -z "$latest_gem" ]]; then
51
- logger_fatal "no gems found"
52
- exit 1
53
- fi
54
-
55
- gem push "$latest_gem"
56
- }
57
-
58
- require sub "$BASH_SOURCE" "$@"
@@ -1,58 +0,0 @@
1
- #!/bin/bash
2
-
3
- #/ NAME
4
- #/ publish-gem -- publish a gem to a local, remote rubygems, geminabox repository
5
- #/
6
- #/ SYNOPSIS
7
- #/ publish gem [--public | --private | --local]
8
-
9
- # figure out the project root under which bin, lib live
10
- shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
11
-
12
- # load a jason bourne library
13
- source "$shome/libexec/_jason"
14
-
15
- # define command line options:
16
- DEFINE_boolean "private" "$FLAGS_TRUE" "push to a local, private geminabox"
17
- DEFINE_boolean "shared" "$FLAGS_FALSE" "push to a shared, private geminabox"
18
- DEFINE_boolean "public" "$FLAGS_FALSE" "push to rubygems.org"
19
-
20
- # entry point
21
- function main {
22
- if [[ "$FLAGS_public" = "$FLAGS_TRUE" ]]; then
23
- push_gem "$@"
24
- elif [[ "$FLAGS_private" = "$FLAGS_TRUE" ]]; then
25
- push_gem_private
26
- else
27
- logger_fatal "must specify --public to confirm a gem push to rubygems.org"
28
- exit 1
29
- fi
30
- }
31
-
32
- # push a gem locally
33
- function push_gem_private {
34
- if [[ "$#" = 0 ]]; then
35
- set +f
36
- local latest_gem="$(ls -td *.gem 2>&- | head -1)"
37
- push_gem_private "$latest_gem"
38
- set -f
39
- else
40
- gem inabox -g http://localhost:9292 "$@"
41
- fi
42
- }
43
-
44
- # push the latest gem to rubygems.org
45
- function push_gem {
46
- set +f
47
- local latest_gem="$(ls -td *.gem 2>&- | head -1)"
48
- set -f
49
-
50
- if [[ -z "$latest_gem" ]]; then
51
- logger_fatal "no gems found"
52
- exit 1
53
- fi
54
-
55
- gem push "$latest_gem"
56
- }
57
-
58
- require sub "$BASH_SOURCE" "$@"