jade_systems_toolbox 0.2.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34c1084f87c203c6d008d7c871bfeeeeba556d5208575df9a00c5c7e6c0f95a2
4
- data.tar.gz: fa4ced1128644400b4bc691cbf9537570edf6246400dbea55a1944b2a3ec85a5
3
+ metadata.gz: 6e5e58dc71de22b037aab057b8a9205361a239590b6b844f438b59fdd771441f
4
+ data.tar.gz: 1b6a2766065ad815318eb62d463c3d5113ac3ed4b6e293c6aa883f6b3e174845
5
5
  SHA512:
6
- metadata.gz: 9ad77d436e5dcdd4f8552bd19c60e53d253dd83daa1cba573c4e6a6f9c9a188ab15b5695e85a13612752e5a04acb624dd0c4e3a63a6342c3891c7efc3ee79c08
7
- data.tar.gz: 303847847a630d6fdb089932957f7415ea163256c14ca728d163df3bfc64319037a7479acb81b127808119a95cccfedb796d36c97297ad0a5f36166869cbd95d
6
+ metadata.gz: 257d930928d5186d49415b1cc25b28122e5dada2753610ef3346ef39aa6174b01c89a43dfa567464caca71ea0c23982d9bb876e544e1fd4ae2fed4c4b29548e7
7
+ data.tar.gz: 51ea308a86ef16a12d8d2cb43dbe300558e3b97ed4aa0fe009834ad6c226121c58cc3e287639132f425f0d50ae2da3b907b9698349e9ec9775df551dd9eb28b6
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  This gem installs a program to help do container-based development. It provides functions to:
4
4
 
5
5
  * Prepare a directory for development in containers, including some files to configure VScode.
6
- * Bring up the container(s).
6
+ * Start the container(s).
7
7
  * Open VScode on the code in the container.
8
8
  * Open a browser window on the application-under-development's web server.
9
9
  * Open a terminal session on the application container.
@@ -29,7 +29,7 @@ gem install --user-install jade_systems_toolbox
29
29
 
30
30
  ```terminal
31
31
  Commands:
32
- tool down -- COMPOSE_ARGS # docker compose down. Deletes the container. You probably want stop.
32
+ tool down -- [COMPOSE_ARGS] # docker compose down. Deletes the container. You probably want stop.
33
33
  tool edit # devcontainer open
34
34
  tool exec COMMAND [ARGS] # Run a command in the container and exit
35
35
  tool help [COMMAND] # Describe available commands or one specific command
@@ -58,7 +58,7 @@ The broad steps to start a brand new project are:
58
58
  1. Create a directory for the project, and change directory into the new directory.
59
59
  1. Decide which container(s) you want to use.
60
60
  1. Initialize the container(s).
61
- 1. Bring up the container(s).
61
+ 1. Start the container(s).
62
62
  1. Open a terminal session and create the application (e.g. `rails new` if you're doing a Rails project.)
63
63
  1. Run the editor and otherwise do what you need to do to create your project.
64
64
  1. When the web server is ready to run (if you're developing a web app), run the server.
@@ -85,7 +85,9 @@ tool init
85
85
 
86
86
  The initialization installs
87
87
 
88
- * A `compose.yml` file for Rails development with a SQLite database, using Ruby 3.4, and the `bookworm` version of Debian.
88
+ * A `compose.yml` file for Rails development with a SQLite database, using the latest released version of Ruby,
89
+ and the latest stable version of Debian.
90
+ (Give or take. We don't track the releases so closely. Raise and issue if you need an upgrade.)
89
91
  * On Linux, a `compose.override.yml` file.
90
92
  * A `.devcontainer.json` file, so VScode can edit without the context of the container.
91
93
  * `.vscode/settings.json` and `vscode/extensions.json` so developers have a consistent experience in VScode (mostly linting and autoformatting).
@@ -130,8 +132,8 @@ You can add additional Docker Compose arguments to the command line. For example
130
132
  tool start --remove-orphans
131
133
  ```
132
134
 
133
- If any of the command's arguments are the same as any of `tool`'s arguments,
134
- separate the `exec` command from the rest of the command line with `--`,
135
+ If any of the Docker Compose arguments are the same as any of `tool`'s arguments,
136
+ separate the `start` command from the rest of the command line with `--`,
135
137
  like this: `tool start -- -v`.
136
138
 
137
139
  #### Open a Terminal Session
@@ -232,7 +234,7 @@ You can add additional Docker Compose arguments to the command line. For example
232
234
  tool stop --remove-orphans
233
235
  ```
234
236
 
235
- If any of the command's arguments are the same as any of `tool`'s arguments,
237
+ If any of the Docker Compose arguments are the same as any of `tool`'s arguments,
236
238
  separate the `exec` command from the rest of the command line with `--`,
237
239
  like this: `tool stop -- -v`.
238
240
 
@@ -244,7 +246,7 @@ tool exec ls -l ..
244
246
 
245
247
  Some things to watch for:
246
248
 
247
- - If any of the command's arguments are the same as any of `tool`'s arguments,
249
+ - If any of the Docker Compose arguments are the same as any of `tool`'s arguments,
248
250
  separate the `exec` command from the rest of the command line with `--`,
249
251
  like this: `tool exec -- ls -l -t ..`.
250
252
  - The shell on the host processes the command line,
@@ -264,10 +266,10 @@ tool down
264
266
  You can add additional Docker Compose arguments to the command line. For example: NOTE THAT THE FOLLOWING COMMAND IS VERY DESTRUCTIVE. It destroys the volume where you might have your development and test databases, or other important data:
265
267
 
266
268
  ```bash
267
- tool start -- -v
269
+ tool down --volumes --remove-orphans
268
270
  ```
269
271
 
270
- If any of the command's arguments are the same as any of `tool`'s arguments,
272
+ If any of the Docker Compose arguments are the same as any of `tool`'s arguments,
271
273
  separate the `exec` command from the rest of the command line with `--`,
272
274
  like this: `tool down -- -v`.
273
275
 
@@ -293,7 +295,7 @@ To run in another directory, use the path from the directory you're in, to the d
293
295
  ruby -I ../jade_systems_toolbox/lib ../jade_systems_toolbox/exe/tool [COMMAND]
294
296
  ```
295
297
 
296
- To install this gem onto your local machine, build it: `gem build jade_systems_toolbox.gemspec`, and install it: `gem install -l jade_systems_toolbox-0.1.4.gem`. (Change the version number to match the current version number.)
298
+ To install this gem onto your local machine, build it: `gem build jade_systems_toolbox.gemspec`, and install it: `gem install -l jade_systems_toolbox-0.2.0.gem`. (Change the version number to match the current version number.)
297
299
 
298
300
  ## Release
299
301
 
@@ -14,7 +14,7 @@ module JadeSystemsToolbox
14
14
 
15
15
  class_option :verbose, type: :boolean, default: false, aliases: "-v"
16
16
 
17
- desc "down -- COMPOSE_ARGS", "docker compose down. Deletes the container. You probably want stop."
17
+ desc "down -- [COMPOSE_ARGS]", "docker compose down. Deletes the container. You probably want stop."
18
18
  option :force, default: "n", aliases: "-f"
19
19
  def down(*compose_args)
20
20
  force = ask("tool down destroys the containers. Are you sure [y/N]?").downcase unless options[:force] == "y"
@@ -97,7 +97,16 @@ module JadeSystemsToolbox
97
97
  container_ports = compose_yaml.dig("services", service, "ports")
98
98
  container_port = container_ports&.[](0) || container_port
99
99
  path = "/#{path}" if path[0] != "/"
100
- `open "#{protocol}://localhost:#{host_port_from_container_port(service:, container_port:)}#{path}"`
100
+ url = "#{protocol}://localhost:#{host_port_from_container_port(service:, container_port:)}#{path}"
101
+ if `command -v "open"`
102
+ # Real Unix :-)
103
+ system "open #{url}"
104
+ elsif `command -v "cmd.exe"`
105
+ # WSL because this opens a URL in the browser, which will be on Windows.
106
+ system "cmd.exe /c start #{url}"
107
+ else
108
+ raise ArgumentError, "no suitable command available to open app."
109
+ end
101
110
  end
102
111
 
103
112
  desc "port [CONTAINER_PORT]", "Get the host port for the CONTAINER_PORT's container port CONTAINER_PORT"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JadeSystemsToolbox
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jade_systems_toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Larry Reid
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-09 00:00:00.000000000 Z
11
+ date: 2026-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor