gli 2.21.1 → 2.21.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c5897528d1a6f46c909f258df73970b5d91b23442fabbbe3324266462e61153
4
- data.tar.gz: fe51d0fdfed0f4ee886f13d0cc70d02b346dd5e2243323927b0641e724173a15
3
+ metadata.gz: 33feccb199126e4e39e227aaddd88d3d0a270bc3954a2e47a20f3613049eec3b
4
+ data.tar.gz: f1530371f4226510065a4acdc3d884bedee3e877979428c06579747863e02c8d
5
5
  SHA512:
6
- metadata.gz: 7877fdd663edee99a4df3a6c18c4df51fda9058382736583b22fac289834642eec9088800323df8168cf2d726ac8dcc7411f8686a1b5c57e2aa226fa7fc99312
7
- data.tar.gz: d8f84289b949bd8d92ed1716327e8c8446b9bef71a596d9c9d30f5a098957c1b53bd48b3b9d848d005e6543139222514bda226476b50054d644eb2e2846070b3
6
+ metadata.gz: ca8f6b6130a39c4074b90633fdb4ae6261cfeff78f41928d8afae1e2fe1a7e6bb7429536569b891e44084a3ae719a204e1ebea8dea7052d5b257c9f50bff85b8
7
+ data.tar.gz: 1ef6e27dbf75f34e06735c0f1fda33d0ee09989f5f0d165d5d79efbbd148c04d1507f8a580f7b177d0c9b4140a55035db5ed1210f79ef717d60d62f6754221a2
data/.gitignore CHANGED
@@ -11,3 +11,7 @@ results.html
11
11
  .DS_Store
12
12
  Session.vim
13
13
  scaffold_test
14
+ dx/docker-compose.local.env
15
+ docker-compose.dx.yml
16
+ .tool-versions
17
+ .ruby-version
data/CONTRIBUTING.md CHANGED
@@ -1,21 +1,60 @@
1
- Contributions are welcome as long as they are part of my vision for GLI (or can be treated as optional to the user). I am obsessive about backwards-compatibility, so you may need to default things to disable your features. Sorry, not ready to bump a major version any time soon.
2
-
3
- 1. Fork my Repository
4
- 2. Create a branch off of main
5
- 3. Make your changes:
6
- * Please include tests and watch out for reek and roodi; i.e. keep your code clean
7
- * If you make changes to the gli executable or the scaffolding, please update the cucumber features
8
- * Please rubydoc any new methods and update the rubydoc to methods you change in the following format:
9
- ```ruby
10
- # Short description
11
- #
12
- # Longer description if needed
13
- #
14
- # +args+:: get documented using this syntax
15
- # +args+:: please state the TYPE of every arg
16
- #
17
- # Returns goes here, please state the TYPE of what's returned, if anything
18
- ```
19
- * Use <code># :nodoc:</code> for methods that a _user_ of GLI should not call (but still please do document all methods)
20
- 4. Make sure your branch will merge with my gli-2 branch (or just rebase your branch from my gli-2 branch)
21
- 5. Create a pull request explaining your change
1
+ # Contributing/Developing
2
+
3
+ ## Types of Contributions
4
+
5
+ GLI is relatively stable. As such:
6
+
7
+ * No major new features should be added
8
+ * No refactorings or "modernization" is desired
9
+ * No runtime dependencies should be added.
10
+
11
+ If you really want to make a change like this, open an issue first to discuss.
12
+
13
+ That said, I welcome:
14
+
15
+ * Bugfixes
16
+ * Doc changes
17
+ * Minor improvements
18
+
19
+ I am responsive on issues, so reach out there if you have a question.
20
+
21
+ ## How to Do Development
22
+
23
+ GLI us using a Docker-based development system to ensure consistency. To use it, you will need to have Docker installed, as well
24
+ as Bash. This should all work under Windows Subsystem for Linux.
25
+
26
+ ### Setting Up
27
+
28
+ 1. Install Docker
29
+ 2. `dx/build`
30
+
31
+ This will use `Dockerfile.dx` to create one Docker image for each supported Ruby version (see `dx/docker-compose.env`'s `RUBY_VERSIONS` variable for the current list). This will also generate `docker-compose.dx.yml` which will run all versions of Ruby for GLI at the same time.
32
+ 3. `dx/start`
33
+
34
+ This will start Docker using `docker-compose.dx.yml`, which will run containers for all the images generated by `dx/build`
35
+
36
+ 4. From here, you can run commands inside the running containers, or you can run `bash` inside a container to effectively "log
37
+ in" and run commands.
38
+
39
+ ### Doing Development
40
+
41
+ Once you are set up, you should run `dx/exec bash`. This will log you into the container running the oldest supported version of
42
+ Ruby. This is the version where you should do your basic work. This container has access to the source code you cloned from
43
+ GitHub.
44
+
45
+ 1. `on-your-computer> dx/exec bash`
46
+ 2. `inside-docker-container> bin/setup # installs all gems`
47
+ 3. `inside-docker-container> bin/rake # runs all tests`
48
+
49
+ Once you have stuff working, run tests on the other versions. Since the container you were working in was operating on your
50
+ checked-out files, the other containers will have access as well.
51
+
52
+ 1. `on-your-computer> dx/exec -v 3.3 bash # connects to the conatiner where Ruby 3.3 is installed`
53
+ 2. `inside-docker-container> bin/setup # installs all gems`
54
+ 3. `inside-docker-container> bin/rake # runs all tests`
55
+
56
+ #### If You Want To Use Your Local Computer
57
+
58
+ In theory, GLI can be worked on using RVM, RBEnv, asdf, or whatever other way you want to manage Ruby. You can create a
59
+ `.ruby-version` or `.tool-versions`. These are ignored so you can keep them on your machine. I don't support this setup, so if
60
+ something is wrong, I probably can't help. This is why I have it set up with Docker.
data/Dockerfile.dx ADDED
@@ -0,0 +1,28 @@
1
+ ARG RUBY_VERSION
2
+ FROM ruby:${RUBY_VERSION}
3
+
4
+ ENV DEBIAN_FRONTEND noninteractive
5
+ RUN apt-get -y update
6
+
7
+
8
+ # dx.snippet.start=templates/snippets/bundler/latest__bundler.dockerfile-snippet
9
+ # Based on documentation at https://guides.rubygems.org/command-reference/#gem-update
10
+ # based on the vendor's documentation
11
+ RUN echo "gem: --no-document" >> ~/.gemrc && \
12
+ gem update --system && \
13
+ gem install bundler
14
+
15
+ # dx.snippet.end=templates/snippets/bundler/latest__bundler.dockerfile-snippet
16
+
17
+
18
+ # dx.snippet.start=templates/snippets/vim/bullseye_vim.dockerfile-snippet
19
+ # Based on documentation at https://packages.debian.org/search?keywords=vim
20
+ # based on the vendor's documentation
21
+ ENV EDITOR=vim
22
+ RUN apt-get install -y vim && \
23
+ echo "set -o vi" >> /root/.bashrc
24
+ # dx.snippet.end=templates/snippets/vim/bullseye_vim.dockerfile-snippet
25
+
26
+ # This entrypoint produces a nice help message and waits around for you to do
27
+ # something with the container.
28
+ COPY dx/show-help-in-app-container-then-wait.sh /root
data/README.rdoc CHANGED
@@ -92,9 +92,9 @@ Get a more detailed walkthrough on the {main site}[http://davetron5000.github.io
92
92
 
93
93
  == Supported Platforms
94
94
 
95
- See `.circleci/config.yml` for the supported rubies, but general we're running tests on the all MRI rubies receiving support, which tends to be the most recent four versions.
95
+ See `dx/docker-compose.env` and the variable `RUBY_VERSIONS` for the versions that are supported. This should generally track with the supported version of Ruby from Ruby's maintainers.
96
96
 
97
- GLI should work on older Rubies and JRuby, but it's too much work to keep tests passing for those.
97
+ That said, GLI should generally work on other Rubies as it doesn't have any runtime dependencies and there are no plans to use more modern features of Ruby in the codebase.
98
98
 
99
99
  == Documentation
100
100
 
@@ -102,6 +102,10 @@ Extensive documentation is {available at the wiki}[https://github.com/davetron50
102
102
 
103
103
  API Documentation is available {here}[http://davetron5000.github.io/gli/rdoc/index.html]. Recommend starting with GLI::DSL or GLI::App.
104
104
 
105
+ == Developing
106
+
107
+ See `CONTRIBUTING.md`
108
+
105
109
  == Credits
106
110
 
107
111
  Author:: Dave Copeland (mailto:davetron5000 at g mail dot com)
data/Rakefile CHANGED
@@ -80,6 +80,9 @@ Rake::TestTask.new("test:unit") do |t|
80
80
  ENV["RUBYOPT"].split(/\s/).each do |opt|
81
81
  t.ruby_opts << opt
82
82
  end
83
+ if t.ruby_opts.none? { |x| x =~ /^\-W/ }
84
+ t.ruby_opts << "-W0"
85
+ end
83
86
  t.test_files = FileList["test/unit/**/*_test.rb"]
84
87
  end
85
88
 
@@ -89,6 +92,9 @@ Rake::TestTask.new("test:integration") do |t|
89
92
  ENV["RUBYOPT"].split(/\s/).each do |opt|
90
93
  t.ruby_opts << opt
91
94
  end
95
+ if t.ruby_opts.none? { |x| x =~ /^\-W/ }
96
+ t.ruby_opts << "-W0"
97
+ end
92
98
  explicitly_named_files = ARGV[1..-1]
93
99
  if Array(explicitly_named_files).size == 0
94
100
  t.test_files = FileList["test/integration/**/*_test.rb"]
data/bin/setup CHANGED
@@ -1,5 +1,11 @@
1
1
  #!/bin/bash
2
2
 
3
3
  set -e
4
-
5
- bundle check || bundle install
4
+ if [ Gemfile.lock -ot gli.gemspec ] ; then
5
+ echo "[ bin/setup ] gli.gemspec has been modified - deleting Gemfile.lock"
6
+ rm Gemfile.lock
7
+ bundle install
8
+ else
9
+ echo "[ bin/setup ] checking bundle and updating as necessary"
10
+ bundle check || bundle install
11
+ fi
data/dx/build ADDED
@@ -0,0 +1,60 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ SCRIPT_DIR=$( cd -- "$( dirname -- "${0}" )" > /dev/null 2>&1 && pwd )
6
+
7
+ . "${SCRIPT_DIR}/dx.sh.lib"
8
+
9
+ require_command "docker"
10
+ load_docker_compose_env
11
+
12
+ usage_on_help "Builds the Docker image based on the Dockerfile" "" "build.pre" "build.post" "${@}"
13
+
14
+ for ruby_version in ${RUBY_VERSIONS[@]}; do
15
+ dockerfile="Dockerfile.dx"
16
+ docker_image_name="${IMAGE}:ruby-${ruby_version}"
17
+
18
+ log "Building for Ruby '${ruby_version}' using Docker image name '${docker_image_name}'"
19
+
20
+ exec_hook_if_exists "build.pre" "${dockerfile}" "${docker_image_name}"
21
+
22
+ docker build \
23
+ --file "${dockerfile}" \
24
+ --build-arg="RUBY_VERSION=${ruby_version}" \
25
+ --tag "${docker_image_name}" \
26
+ ./
27
+
28
+ exec_hook_if_exists "build.post" "${dockerfile}" "${docker_image_name}"
29
+ log "🌈" "Your Docker image has been built tagged '${docker_image_name}'"
30
+ done
31
+
32
+ log "✅" "All images built"
33
+
34
+ log "✨" "Creating docker-compose.dx.yml"
35
+ compose_file="docker-compose.dx.yml"
36
+ log "🗑️" "Deleting previous ${compose_file}"
37
+
38
+ rm "${compose_file}"
39
+ echo "# THIS IS GENERATED - DO NOT EDIT" > "${compose_file}"
40
+ echo "" >> "${compose_file}"
41
+ echo "services:" >> "${compose_file}"
42
+
43
+ for ruby_version in ${RUBY_VERSIONS[@]}; do
44
+ log "Generating stanza for version '${ruby_version}'"
45
+ docker_image_name="${IMAGE}:ruby-${ruby_version}"
46
+ echo " gli-${ruby_version}:" >> "${compose_file}"
47
+ echo " image: ${docker_image_name}" >> "${compose_file}"
48
+ echo " init: true" >> "${compose_file}"
49
+ echo " volumes:" >> "${compose_file}"
50
+ echo " - type: bind" >> "${compose_file}"
51
+ echo " source: \"./\"" >> "${compose_file}"
52
+ echo " target: \"/root/work\"" >> "${compose_file}"
53
+ echo " consistency: \"consistent\"" >> "${compose_file}"
54
+ echo " entrypoint: /root/show-help-in-app-container-then-wait.sh" >> "${compose_file}"
55
+ echo " working_dir: /root/work" >> "${compose_file}"
56
+ done
57
+ log "🎼" "${compose_file} is noq created"
58
+ log "🔄" "You can run dx/start to start it up, though you may need to stop it first with Ctrl-C"
59
+
60
+ # vim: ft=bash
@@ -0,0 +1,5 @@
1
+ # This array must include the oldest Ruby first!
2
+ RUBY_VERSIONS=("3.1" "3.2" "3.3")
3
+ IMAGE=davetron5000/gli-dev
4
+ PROJECT_NAME=gli
5
+ # vim: ft=bash
data/dx/dx.sh.lib ADDED
@@ -0,0 +1,24 @@
1
+ # shellcheck shell=bash
2
+
3
+ . "${SCRIPT_DIR}/setupkit.sh.lib"
4
+
5
+ require_command "realpath"
6
+ require_command "cat"
7
+
8
+ ENV_FILE=$(realpath "${SCRIPT_DIR}")/docker-compose.env
9
+
10
+ load_docker_compose_env() {
11
+ . "${ENV_FILE}"
12
+ }
13
+
14
+ exec_hook_if_exists() {
15
+ script_name=$1
16
+ shift
17
+ if [ -x "${SCRIPT_DIR}"/"${script_name}" ]; then
18
+ log "🪝" "${script_name} exists - executing"
19
+ "${SCRIPT_DIR}"/"${script_name}" "${@}"
20
+ else
21
+ debug "${script_name} does not exist"
22
+ fi
23
+ }
24
+ # vim: ft=bash
data/dx/exec ADDED
@@ -0,0 +1,59 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ SCRIPT_DIR=$( cd -- "$( dirname -- "${0}" )" > /dev/null 2>&1 && pwd )
6
+
7
+ . "${SCRIPT_DIR}/dx.sh.lib"
8
+
9
+ require_command "docker"
10
+ load_docker_compose_env
11
+
12
+ usage_description="Execute a command inside the app's container."
13
+ usage_args="[-s service] [-v ruby_version] command"
14
+ usage_pre="exec.pre"
15
+ usage_on_help "${usage_description}" "${usage_args}" "${usage_pre}" "" "${@}"
16
+
17
+ LATEST_RUBY=${RUBY_VERSIONS[0]}
18
+ DEFAULT_SERVICE=gli-${LATEST_RUBY}
19
+ SERVICE="${SERVICE_NAME:-${DEFAULT_SERVICE}}"
20
+ while getopts "v:s:" opt "${@}"; do
21
+ case ${opt} in
22
+ v )
23
+ SERVICE="gli-${OPTARG}"
24
+ ;;
25
+ s )
26
+ SERVICE="${OPTARG}"
27
+ ;;
28
+ \? )
29
+ log "🛑" "Unknown option: ${opt}"
30
+ usage "${description}" "${usage_args}" "${usage_pre}"
31
+ ;;
32
+ : )
33
+ log "🛑" "Invalid option: ${opt} requires an argument"
34
+ usage "${description}" "${usage_args}" "${usage_pre}"
35
+ ;;
36
+ esac
37
+ done
38
+ shift $((OPTIND -1))
39
+
40
+ if [ $# -eq 0 ]; then
41
+ log "🛑" "You must provide a command e.g. bash or ls -l"
42
+ usage "${description}" "${usage_args}" "${usage_pre}"
43
+ fi
44
+
45
+
46
+ exec_hook_if_exists "exec.pre"
47
+
48
+ log "🚂" "Running '${*}' inside container with service name '${SERVICE}'"
49
+
50
+ docker \
51
+ compose \
52
+ --file docker-compose.dx.yaml \
53
+ --project-name "${PROJECT_NAME}" \
54
+ --env-file "${ENV_FILE}" \
55
+ exec \
56
+ "${SERVICE}" \
57
+ "${@}"
58
+
59
+ # vim: ft=bash
data/dx/prune ADDED
@@ -0,0 +1,19 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ SCRIPT_DIR=$( cd -- "$( dirname -- "${0}" )" > /dev/null 2>&1 && pwd )
6
+
7
+ . "${SCRIPT_DIR}/dx.sh.lib"
8
+ require_command "docker"
9
+ load_docker_compose_env
10
+
11
+ usage_on_help "Prune containers for this repo" "" "" "" "${@}"
12
+
13
+ for container_id in $(docker container ls -a -f "name=^${PROJECT_NAME}-.*-1$" --format="{{.ID}}"); do
14
+ log "🗑" "Removing container with id '${container_id}'"
15
+ docker container rm "${container_id}"
16
+ done
17
+ echo "🧼" "Containers removed"
18
+
19
+ # vim: ft=bash
@@ -0,0 +1,144 @@
1
+ # shellcheck shell=bash
2
+
3
+ fatal() {
4
+ remainder=${*:2}
5
+ if [ -z "$remainder" ]; then
6
+ log "🛑" "${@}"
7
+ else
8
+ log "${@}"
9
+ fi
10
+ exit 1
11
+ }
12
+
13
+ log() {
14
+ emoji=$1
15
+ remainder=${*:2}
16
+ if [ -z "${NO_EMOJI}" ]; then
17
+ echo "[ ${0} ] ${*}"
18
+ else
19
+ # if remainder is empty that means no emoji was passed
20
+ if [ -z "$remainder" ]; then
21
+ echo "[ ${0} ] ${*}"
22
+ else # emoji was passed, but we ignore it
23
+ echo "[ ${0} ] ${remainder}"
24
+ fi
25
+ fi
26
+ }
27
+
28
+ debug() {
29
+ message=$1
30
+ if [ -z "${DOCKBOX_DEBUG}" ]; then
31
+ return
32
+ fi
33
+ log "🐛" "${message}"
34
+ }
35
+
36
+ usage() {
37
+ description=$1
38
+ arg_names=$2
39
+ pre_hook=$3
40
+ post_hook=$4
41
+ echo "usage: ${0} [-h] ${arg_names}"
42
+ if [ -n "${description}" ]; then
43
+ echo
44
+ echo "DESCRIPTION"
45
+ echo " ${description}"
46
+ fi
47
+ if [ -n "${pre_hook}" ] || [ -n "${post_hook}" ]; then
48
+ echo
49
+ echo "HOOKS"
50
+ if [ -n "${pre_hook}" ]; then
51
+ echo " ${pre_hook} - if present, called before the main action"
52
+ fi
53
+ if [ -n "${post_hook}" ]; then
54
+ echo " ${post_hook} - if present, called after the main action"
55
+ fi
56
+ fi
57
+ exit 0
58
+ }
59
+
60
+ usage_on_help() {
61
+ description=$1
62
+ arg_names=$2
63
+ pre_hook=$3
64
+ post_hook=$4
65
+ # These are the args passed to the invocation so this
66
+ # function can determine if the user requested help
67
+ cli_args=( "${@:5}" )
68
+
69
+ for arg in "${cli_args[@]}"; do
70
+ if [ "${arg}" = "-h" ] || [ "${arg}" = "--help" ]; then
71
+ usage "${description}" "${arg_names}" "${pre_hook}" "${post_hook}"
72
+ fi
73
+ done
74
+ }
75
+
76
+ # Read user input into the variable 'INPUT'
77
+ #
78
+ # Args:
79
+ #
80
+ # [1] - an emoji to use for messages
81
+ # [2] - the message explaining what input is being requested
82
+ # [3] - a default value to use if no value is provided
83
+ #
84
+ # Respects NO_EMOJI when outputing messages to the user
85
+ user_input() {
86
+ emoji=$1
87
+ message=$2
88
+ default=$3
89
+ prompt=$4
90
+
91
+ if [ -z "$message" ]; then
92
+ echo "user_input requires a message"
93
+ exit 1
94
+ fi
95
+
96
+ INPUT=
97
+
98
+ if [ -z "${prompt}" ]; then
99
+ prompt=$(log "${emoji}" "Value: ")
100
+ if [ -n "${default}" ]; then
101
+ prompt=$(log "${emoji}" "Value (or hit return to use '${default}'): ")
102
+ fi
103
+ fi
104
+
105
+ while [ -z "${INPUT}" ]; do
106
+
107
+ log "$emoji" "$message"
108
+ read -r -p "${prompt}" INPUT
109
+ if [ -z "$INPUT" ]; then
110
+ INPUT=$default
111
+ fi
112
+ if [ -z "$INPUT" ]; then
113
+ log "😶", "You must provide a value"
114
+ fi
115
+ done
116
+ }
117
+
118
+ user_confirm() {
119
+ user_input "$1" "$2" "$3" "y/n> "
120
+ }
121
+
122
+ require_not_exist() {
123
+ file=$1
124
+ message=$2
125
+ if [ -e "${file}" ]; then
126
+ fatal "$message"
127
+ fi
128
+ }
129
+ require_exist() {
130
+ file=$1
131
+ message=$2
132
+ if [ ! -e "${file}" ]; then
133
+ fatal "$message"
134
+ fi
135
+ }
136
+
137
+ require_command() {
138
+ command_name=$1
139
+ if ! command -v "${command_name}" >/dev/null 2>&1; then
140
+ fatal "Command '${command_name}' not found - it is required for this script to run"
141
+ fi
142
+ }
143
+
144
+ # vim: ft=bash
@@ -0,0 +1,38 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ # Ideally, the message below is shown after everything starts up. We can't
6
+ # achieve this using healtchecks because the interval for a healtcheck is
7
+ # also an initial delay, and we don't really want to do healthchecks on
8
+ # our DB or Redis every 2 seconds. So, we sleep just a bit to let
9
+ # the other containers start up and vomit out their output first.
10
+ sleep 2
11
+ # Output some helpful messaging when invoking `dx/start` (which itself is
12
+ # a convenience script for `docker compose up`.
13
+ #
14
+ # Adding this to work around the mild inconvenience of the `app` container's
15
+ # entrypoint generating no output.
16
+ #
17
+ cat <<-'PROMPT'
18
+
19
+
20
+
21
+ 🎉 Dev Environment Initialized! 🎉
22
+
23
+ ℹ️ To use this environment, open a new terminal and run
24
+
25
+ dx/exec bash
26
+
27
+ 🕹 Use `ctrl-c` to exit.
28
+
29
+
30
+
31
+ PROMPT
32
+
33
+ # Using `sleep infinity` instead of `tail -f /dev/null`. This may be a
34
+ # performance improvement based on the conversation on a semi-related
35
+ # StackOverflow page.
36
+ #
37
+ # @see https://stackoverflow.com/a/41655546
38
+ sleep infinity
data/dx/start ADDED
@@ -0,0 +1,30 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ SCRIPT_DIR=$( cd -- "$( dirname -- "${0}" )" > /dev/null 2>&1 && pwd )
6
+
7
+ . "${SCRIPT_DIR}/dx.sh.lib"
8
+ require_command "docker"
9
+ load_docker_compose_env
10
+
11
+ usage_on_help "Starts all services, including a container in which to run your app" "" "" "" "${@}"
12
+
13
+ log "🚀" "Starting docker-compose.dx.yml"
14
+
15
+ BUILD=--build
16
+ if [ "${1}" == "--no-build" ]; then
17
+ BUILD=
18
+ fi
19
+
20
+ docker \
21
+ compose \
22
+ --file docker-compose.dx.yml \
23
+ --project-name "${PROJECT_NAME}" \
24
+ --env-file "${ENV_FILE}" \
25
+ up \
26
+ "${BUILD}" \
27
+ --timestamps \
28
+ --force-recreate
29
+
30
+ # vim: ft=bash
data/dx/stop ADDED
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ SCRIPT_DIR=$( cd -- "$( dirname -- "${0}" )" > /dev/null 2>&1 && pwd )
6
+
7
+ . "${SCRIPT_DIR}/dx.sh.lib"
8
+ require_command "docker"
9
+ load_docker_compose_env
10
+
11
+ usage_on_help "Stops all services, the container in which to run your app and removes any volumes" "" "" "" "${@}"
12
+
13
+ log "🚀" "Stopping docker-compose.dx.yml"
14
+
15
+ docker \
16
+ compose \
17
+ --file docker-compose.dx.yml \
18
+ --project-name "${PROJECT_NAME}" \
19
+ --env-file "${ENV_FILE}" \
20
+ down \
21
+ --volumes
22
+
23
+ # vim: ft=bash
data/gli.gemspec CHANGED
@@ -26,5 +26,5 @@ spec = Gem::Specification.new do |s|
26
26
  s.add_development_dependency("rdoc")
27
27
  s.add_development_dependency("rainbow", "~> 1.1", "~> 1.1.1")
28
28
  s.add_development_dependency("sdoc")
29
- s.add_development_dependency("minitest")
29
+ s.add_development_dependency("minitest", "~> 5")
30
30
  end
@@ -121,7 +121,7 @@ Rake::RDocTask.new do |rd|
121
121
  rd.title = 'Your application title'
122
122
  end
123
123
 
124
- spec = eval(File.read('#{project_name}.gemspec'))
124
+ spec = Gem::Specification.load("#{project_name}.gemspec")
125
125
 
126
126
  Gem::PackageTask.new(spec) do |pkg|
127
127
  end
data/lib/gli/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module GLI
2
2
  unless const_defined? :VERSION
3
- VERSION = '2.21.1'
3
+ VERSION = '2.21.2'
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  require_relative "test_helper"
2
2
  require "open3"
3
3
 
4
- class GLICLITest < MiniTest::Test
4
+ class GLICLITest < Minitest::Test
5
5
  include TestHelper
6
6
 
7
7
  class AppHelp < GLICLITest
@@ -1,7 +1,7 @@
1
1
  require_relative "test_helper"
2
2
  require "open3"
3
3
 
4
- class GLIPoweredAppTest < MiniTest::Test
4
+ class GLIPoweredAppTest < Minitest::Test
5
5
  include TestHelper
6
6
 
7
7
  def teardown
@@ -1,7 +1,7 @@
1
1
  require_relative "test_helper"
2
2
  require "open3"
3
3
 
4
- class ScaffoldCommandTest < MiniTest::Test
4
+ class ScaffoldCommandTest < Minitest::Test
5
5
  include TestHelper
6
6
 
7
7
  def test_scaffolded_app_has_reasonable_setup
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class CommandFinderTest < MiniTest::Test
3
+ class CommandFinderTest < Minitest::Test
4
4
  include TestHelper
5
5
 
6
6
  def setup
@@ -1,7 +1,7 @@
1
1
  require_relative "test_helper"
2
2
  require_relative "support/fake_std_out"
3
3
 
4
- class CommandTest < MiniTest::Test
4
+ class CommandTest < Minitest::Test
5
5
  include TestHelper
6
6
  def setup
7
7
  @fake_stdout = FakeStdOut.new
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class CompoundCommandFinderTest < MiniTest::Test
3
+ class CompoundCommandFinderTest < Minitest::Test
4
4
  include TestHelper
5
5
 
6
6
  def test_exception_for_missing_commands
@@ -18,7 +18,7 @@ class Object
18
18
  end
19
19
  end
20
20
 
21
- class DocTest < MiniTest::Test
21
+ class DocTest < Minitest::Test
22
22
  include TestHelper
23
23
 
24
24
  class TestApp
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class FlagTest < MiniTest::Test
3
+ class FlagTest < Minitest::Test
4
4
  include TestHelper
5
5
 
6
6
  def test_basics_simple
@@ -1,7 +1,7 @@
1
1
  require_relative "test_helper"
2
2
  require_relative "support/fake_std_out"
3
3
 
4
- class GLITest < MiniTest::Test
4
+ class GLITest < Minitest::Test
5
5
  include TestHelper
6
6
 
7
7
  def setup
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class HelpTest < MiniTest::Test
3
+ class HelpTest < Minitest::Test
4
4
  include TestHelper
5
5
 
6
6
  def setup
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class OptiosnTest < MiniTest::Test
3
+ class OptiosnTest < Minitest::Test
4
4
  include TestHelper
5
5
 
6
6
  def test_by_method
@@ -1,7 +1,7 @@
1
1
  require_relative "test_helper"
2
2
  require_relative "support/fake_std_out"
3
3
 
4
- class SubcommandParsingTest < MiniTest::Test
4
+ class SubcommandParsingTest < Minitest::Test
5
5
  include TestHelper
6
6
 
7
7
  def setup
@@ -1,7 +1,7 @@
1
1
  require_relative "test_helper"
2
2
  require_relative "support/fake_std_out"
3
3
 
4
- class SubcommandsTest < MiniTest::Test
4
+ class SubcommandsTest < Minitest::Test
5
5
  include TestHelper
6
6
 
7
7
  def setup
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class SwitchTest < MiniTest::Test
3
+ class SwitchTest < Minitest::Test
4
4
  include TestHelper
5
5
 
6
6
  def test_basics_simple
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TerminalTest < MiniTest::Test
3
+ class TerminalTest < Minitest::Test
4
4
  include TestHelper
5
5
 
6
6
  # TODO: Make this test not mess with the internals of the class
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TerminalTest < MiniTest::Test
3
+ class TerminalTest < Minitest::Test
4
4
  include TestHelper
5
5
 
6
6
  def test_handles_nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.21.1
4
+ version: 2.21.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Copeland
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-23 00:00:00.000000000 Z
11
+ date: 2024-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -76,16 +76,16 @@ dependencies:
76
76
  name: minitest
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ">="
79
+ - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '0'
81
+ version: '5'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ">="
86
+ - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '0'
88
+ version: '5'
89
89
  description: Build command-suite CLI apps that are awesome. Bootstrap your app, add
90
90
  commands, options and documentation while maintaining a well-tested idiomatic command-line
91
91
  app
@@ -97,10 +97,9 @@ extra_rdoc_files:
97
97
  - README.rdoc
98
98
  - gli.rdoc
99
99
  files:
100
- - ".circleci/config.yml"
101
100
  - ".gitignore"
102
- - ".tool-versions"
103
101
  - CONTRIBUTING.md
102
+ - Dockerfile.dx
104
103
  - Gemfile
105
104
  - LICENSE.txt
106
105
  - README.rdoc
@@ -109,6 +108,15 @@ files:
109
108
  - bin/gli
110
109
  - bin/rake
111
110
  - bin/setup
111
+ - dx/build
112
+ - dx/docker-compose.env
113
+ - dx/dx.sh.lib
114
+ - dx/exec
115
+ - dx/prune
116
+ - dx/setupkit.sh.lib
117
+ - dx/show-help-in-app-container-then-wait.sh
118
+ - dx/start
119
+ - dx/stop
112
120
  - exe/gli
113
121
  - gli.cheat
114
122
  - gli.gemspec
@@ -205,7 +213,7 @@ homepage: http://davetron5000.github.io/gli
205
213
  licenses:
206
214
  - Apache-2.0
207
215
  metadata: {}
208
- post_install_message:
216
+ post_install_message:
209
217
  rdoc_options:
210
218
  - "--title"
211
219
  - Git Like Interface
@@ -224,8 +232,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
232
  - !ruby/object:Gem::Version
225
233
  version: '0'
226
234
  requirements: []
227
- rubygems_version: 3.4.17
228
- signing_key:
235
+ rubygems_version: 3.5.15
236
+ signing_key:
229
237
  specification_version: 4
230
238
  summary: Build command-suite CLI apps that are awesome.
231
239
  test_files: []
data/.circleci/config.yml DELETED
@@ -1,30 +0,0 @@
1
- version: 2.1
2
- orbs:
3
- # See https://circleci.com/developer/orbs/orb/circleci/ruby
4
- ruby: circleci/ruby@2.0.1
5
- jobs: # keyword
6
- test: # my name for the job
7
- parameters: # keyword
8
- ruby-version: # my parameter name
9
- type: string # type is a keyword
10
- docker: # keyword
11
- - image: cimg/base:stable
12
- steps: # keyword
13
- - checkout # magic name
14
- - ruby/install: # ruby/ is from the orb name, install is a command in that orb
15
- version: << parameters.ruby-version >> # magic nonsense for param subst (version param to the command)
16
- - run:
17
- command: "bin/setup"
18
- - run:
19
- command: "bin/ci none"
20
- workflows: # keyword
21
- all-rubies: # my name for the workflow
22
- jobs: # keyword
23
- - test: # my name for the job
24
- matrix: # keyword
25
- parameters: # keyword
26
- # All rubies being maintained per this page:
27
- # https://www.ruby-lang.org/en/downloads/branches/
28
- # These also need to have complete version numbers
29
- # or rvm won't install
30
- ruby-version: [ "3.0.4", "3.1.3", "3.2.2" ]
data/.tool-versions DELETED
@@ -1 +0,0 @@
1
- ruby 2.7.1