jade_systems_toolbox 0.1.3 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77d28ae152583dfee09836b6c268f052e18a3e065db172036839fe63ae1da1f0
4
- data.tar.gz: '08307e9fb8f296a5e71e2d990e7a2edd387e1f9a0cea8d53d1d015da2feefd92'
3
+ metadata.gz: 8bb1d901493c286300b53d74441705dc7402263497e998f5490ca14beac572a5
4
+ data.tar.gz: bc12fcce57604c61fe617eac640c3ab38e6204da916e73124162df78c519e803
5
5
  SHA512:
6
- metadata.gz: 4ab241764b4b1514a4d770a605b2db8053b03986be8e5164a1813832e1241bf97698582046122565642b6d0b9cdb6023c2ca0912923d95224ffff54680733beb
7
- data.tar.gz: cf374537e612eb3011dd2f7dae3d57b318a7d3be9439609f61dff5bc7d87e937d8cbedf2b91a454118dbfd8428f0d6c66ec84f68633bfc3688e5f96f61ef0d45
6
+ metadata.gz: 58b7e44b6210955e1b50fc2601cc018a2434c92c105436bf923ab818577448c8f11cc90ed81128bfa6290c86f455b6aeb4e444682d4966ebc04c7cab1f382c37
7
+ data.tar.gz: 91636de5259a810060040aa51d3cc0fc1bb914358c679e2dc12dad59e639dafcbf3869a0a1f6886228e302154596195503315c92f9ed567cd6394ca708c1d2b1
data/README.md CHANGED
@@ -27,18 +27,19 @@ gem install --user-install jade_systems_toolbox
27
27
 
28
28
  ### Summary
29
29
 
30
- ```
30
+ ```terminal
31
31
  Commands:
32
- tool down # docker compose down
32
+ tool down # docker compose down. Deletes the container. You probably want stop.
33
33
  tool edit # devcontainer open
34
34
  tool help [COMMAND] # Describe available commands or one specific command
35
35
  tool init # Initialize compose files and devcontainer.json
36
36
  tool initialize_docker # Initialize compose files
37
- tool initialize_vscode # Initialize devcontainer.json for vscode
37
+ tool initilize_vscode # Initialize devcontainer.json for vscode
38
38
  tool open # Open a page on the services's first port
39
39
  tool port [CONTAINER_PORT] # Get the host port for the CONTAINER_PORT's container port CONTAINER_PORT
40
40
  tool ports # Get the host ports for the container ports defined in `compose.yml`
41
41
  tool server [COMMAND] # Run the server in the container
42
+ tool stop # Stop the service(s) but preserve the container(s)
42
43
  tool terminal # Run a shell in the container
43
44
  tool up # docker compose up -d
44
45
  tool version # Show the version number of the tool.
@@ -60,7 +61,8 @@ The broad steps to start a brand new project are:
60
61
  1. Run the editor and otherwise do what you need to do to create your project.
61
62
  1. When the web server is ready to run (if you're developing a web app), run the server.
62
63
  1. Open a browser window to the web server.
63
- 1. When you're done, bring down the containers.
64
+ 1. When you're done, stop the containers.
65
+ 1. If you need to delete the containers, down tools.
64
66
 
65
67
  To start:
66
68
 
@@ -176,12 +178,26 @@ If you want to connect to a path other than `/`:
176
178
  tool open --path letter_opener
177
179
  ```
178
180
 
181
+ #### Stop the Containers
182
+
183
+ ```bash
184
+ tool stop
185
+ ```
186
+
179
187
  #### Bring Down the Containers
180
188
 
189
+ This destroys the containers, which will likely destroy all your gems.
190
+
181
191
  ```bash
182
192
  tool down
183
193
  ```
184
194
 
195
+ Skip the confirmation mesage with:
196
+
197
+ ```bash
198
+ tool down --force
199
+ ```
200
+
185
201
  ## Development
186
202
 
187
203
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -192,13 +208,13 @@ To test locally without installing, run the executable like this:
192
208
  ruby -I lib exe/tool [COMMAND]
193
209
  ```
194
210
 
195
- To run in another directory, use the path name from the directory you're in, to the directory where you checked out the gem's code, for example:
211
+ To run in another directory, use the path from the directory you're in, to the directory where you checked out the gem's code. For example:
196
212
 
197
213
  ```bash
198
214
  ruby -I ../jade_systems_toolbox/lib ../jade_systems_toolbox/exe/tool [COMMAND]
199
215
  ```
200
216
 
201
- 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.2.gem`. (Change the version number to match the current version number.)
217
+ 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.)
202
218
 
203
219
  ## Release
204
220
 
@@ -14,8 +14,12 @@ module JadeSystemsToolbox
14
14
 
15
15
  class_option :verbose, type: :boolean, default: false, aliases: "-v"
16
16
 
17
- desc "down", "docker compose down"
17
+ desc "down", "docker compose down. Deletes the container. You probably want stop."
18
+ option :force, default: "n", aliases: "-f"
18
19
  def down
20
+ force = ask("tool down destroys the containers. Are you sure?").downcase unless options[:force] == "y"
21
+ exit(1) if force[0] != "y"
22
+
19
23
  system("docker compose down")
20
24
  end
21
25
 
@@ -47,7 +51,7 @@ module JadeSystemsToolbox
47
51
  /jade:rails-app-[0-9]+\.[0-9]+-\w+-\w+$/,
48
52
  "jade:rails-app-#{options[:ruby_version] || "3.4"}" \
49
53
  "-#{options[:database] || "sqlite"}" \
50
- "-#{options[:distro_version] || bookworm}",
54
+ "-#{options[:distro_version] || "bookworm"}",
51
55
  )
52
56
  end
53
57
 
@@ -118,6 +122,11 @@ module JadeSystemsToolbox
118
122
  system("docker compose exec #{workdir}#{service} #{command}")
119
123
  end
120
124
 
125
+ desc "stop", "Stop the service(s) but preserve the container(s)"
126
+ def stop
127
+ system("docker compose stop")
128
+ end
129
+
121
130
  desc "terminal", "Run a shell in the container"
122
131
  option :service, default: "web"
123
132
  def terminal
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JadeSystemsToolbox
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jade_systems_toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Larry Reid
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  requirements: []
70
- rubygems_version: 3.6.7
70
+ rubygems_version: 4.0.6
71
71
  specification_version: 4
72
72
  summary: A collection of command line commands to support development.
73
73
  test_files: []