This gem installs a program to help do container-based Ruby development with VScode. It provides functions to:
[At the moment, this gem has been tested on native Ubuntu and Ubuntu in WSL (surprisingly, there were a few small differences that had to be handled). In theory, it will do the job for Windows, Macos, and Linux. Feel free to raise issues if it doesn't.]
One of many things this gem doesn't do is impose a Ruby code style on you. The recommended extensions installed by the init command include formatting and linting using RuboCop, but you'll get the default RuboCop rules, or the rules from whatever other RuboCop gem you might use (e.g. https://github.com/rails/rubocop-rails-omakase, or https://github.com/standardrb/standard).
Don't install this gem in your application's Gemfile. It's meant to be a tool available everywhere on your device. Install the gem by executing:
gem install --user-install jade_systems_toolbox
(If you know what the implications are of not putting --user-install, you can install the gem without it.)
Commands:
tool down -- [COMPOSE_ARGS] # docker compose down. Deletes the container. You probably want stop.
tool edit # devcontainer open
tool exec COMMAND [ARGS] # Run a command in the container and exit
tool help [COMMAND] # Describe available commands or one specific command
tool init # Initialize compose files and devcontainer.json
tool initialize_docker # Initialize compose files
tool initialize_vscode # Initialize devcontainer.json for vscode
tool open # Open a page on the services's first port or specified port
tool port [CONTAINER_PORT] # Get the host port for the CONTAINER_PORT's container port CONTAINER_PORT
tool ports # Get the host ports for the container ports defined in `compose.yml`
tool server [COMMAND] # Run the server in the container
tool start [COMPOSE_ARGS] # docker compose up -d (aliased as `up`)
tool stop # Stop the service(s) but preserve the container(s)
tool terminal # Run a shell in the container
tool tree # Print a tree of all available commands
tool version # Show the version number of the tool.
Options:
-v, [--verbose], [--no-verbose], [--skip-verbose]
# Default: false
The broad steps to start a brand new project are:
rails new if you're doing a Rails project.)If you're starting a brand new project (replace "project" with the name you want for the directory):
mkdir project && cd project
If you want to convert an existing project to use container-based development using this tool, change into the directory (replace "project" with the name you want for the directory):
cd project
Be aware that in the "Initialize Containers" step, you're going to overwrite any existing existing .devcontainer.json, compose.yml, and compose.override.yml you have in your project directory.
tool can install compose.yml for Rails development with SQLite, or Postgres, or MySQL, or MariaDB. You can also choose the Ruby version.
[Coming soon: Install a compose file from any URL, and/or choose any image as the base.]
The default intialization command gives you a compose.yml for a SQLite database, on the most recent stable version of Debian, with the most recent version of Ruby:
tool init
The initialization installs (or overwrites, if they exist):
compose.yml file for Rails development with a SQLite database, using the latest released version of Ruby,
and the latest stable version of Debian.
(Give or take. We don't track the releases so closely. Raise and issue if you need an upgrade.)compose.override.yml file..devcontainer.json file, so VScode can edit without the context of the container..vscode/settings.json and .vscode/extensions.json so developers have a consistent experience in VScode (mostly linting and autoformatting).You can change some of the defaults. To choose another database:
tool init --database postgres
The choices are mariadb, mysql, postgres, and sqlite.
To choose a different ruby version and Debian version:
tool init --ruby-version 3.2 --distro-version bullseye
A fairly common variant is to get a compose.yml that also has a Playwright container, for end-to-end system testing with a headless browser:
tool init --end-to-end-tool playwright
You can choose a currently supported Ruby version, and a Debian version that supports that Ruby version, from the containers built by https://github.com/lcreid/docker.
You're free to modify the compose.yml (and compose.override.yml on Linux). Note that if you run tool init again, it will overwrite your change
Keys in Terminal in VScode Don't Work
https://github.com/lcreid/jade_systems_toolbox/issues/26
Labels: bug
Config File
https://github.com/lcreid/jade_systems_toolbox/issues/25
Labels: None
tool open Doesn't Work in WSL
https://github.com/lcreid/jade_systems_toolbox/issues/24
Labels: enhancement
Configure Ports on tool init
https://github.com/lcreid/jade_systems_toolbox/issues/19
Labels: None
Where to Get Compose Files
https://github.com/lcreid/jade_systems_toolbox/issues/18
Labels: Internals
Make compose Files Easier to Maintain
https://github.com/lcreid/jade_systems_toolbox/issues/17
Labels: Internals
Stack Trace for tool terminal When Service isn't Specified
https://github.com/lcreid/jade_systems_toolbox/issues/15
Labels: bug
Initialize for Rails
https://github.com/lcreid/jade_systems_toolbox/issues/10
Labels: None
Use Latest Ruby Version
https://github.com/lcreid/jade_systems_toolbox/issues/8
Labels: None
Make "Init" Commands Safer
https://github.com/lcreid/jade_systems_toolbox/issues/7
Labels: enhancement, good first issue
No CONTRIBUTING document was found. Please check the README and open issues.