Commit graph

17 commits

Author SHA1 Message Date
Ellen Marie Dash
af594f5166 [rubygems/rubygems] Have "gem exec" sort executable names in error message.
This decouples `gem exec` behavior (and tests) from the sort order of
the gemspec.

911cd29159
2025-03-27 13:57:25 +09:00
David Rodríguez
4fe882e2c9 [rubygems/rubygems] Let gem exec raise an error in ambiguous cases
When `gem exec foo` is run, and "foo" is a gem that has multiple
executables, none of them named "foo", raise an error explaining the
situation and telling user to be more specific.

Currently the first command in the executables array is run, but this
may come as surprising sometimes, so better raise an error.

acda5d8f6e
2025-03-24 13:25:07 +09:00
Adam Daniels
3b5b34e3ae [rubygems/rubygems] Set $0 to exe when running gem exec to fix name in CLI output
The $0 value is used in many CLI libraries to determine the name of the
application, when displaying help and error messages.

Without setting this value, it defaults to `gem` which can be confusing.

Before:

```
$ gem exec kamal help
Commands:
  gem accessory           # Manage accessories (db/redis/search)
  gem app                 # Manage application
  gem audit               # Show audit log from servers
  gem build               # Build application image
  gem config              # Show combined config (including secrets!)
  gem deploy              # Deploy app to servers
  gem details             # Show details about all containers
  gem docs [SECTION]      # Show Kamal configuration documentation
  gem help [COMMAND]      # Describe available commands or one specific command
  gem init                # Create config stub in config/deploy.yml and secrets stub in .kamal
  gem lock                # Manage the deploy lock
  gem proxy               # Manage kamal-proxy
  gem prune               # Prune old application images and containers
  gem redeploy            # Deploy app to servers without bootstrapping servers, starting kamal-proxy, pruning, and registry login
  gem registry            # Login and -out of the image registry
  gem remove              # Remove kamal-proxy, app, accessories, and registry session from servers
  gem rollback [VERSION]  # Rollback app to VERSION
  gem secrets             # Helpers for extracting secrets
  gem server              # Bootstrap servers with curl and Docker
  gem setup               # Setup all accessories, push the env, and deploy app to servers
  gem upgrade             # Upgrade from Kamal 1.x to 2.0
  gem version             # Show Kamal version
```

After:

```
$ gem exec kamal help
Commands:
  kamal accessory           # Manage accessories (db/redis/search)
  kamal app                 # Manage application
  kamal audit               # Show audit log from servers
  kamal build               # Build application image
  kamal config              # Show combined config (including secrets!)
  kamal deploy              # Deploy app to servers
  kamal details             # Show details about all containers
  kamal docs [SECTION]      # Show Kamal configuration documentation
  kamal help [COMMAND]      # Describe available commands or one specific command
  kamal init                # Create config stub in config/deploy.yml and secrets stub in .kamal
  kamal lock                # Manage the deploy lock
  kamal proxy               # Manage kamal-proxy
  kamal prune               # Prune old application images and containers
  kamal redeploy            # Deploy app to servers without bootstrapping servers, starting kamal-proxy, pruning, and registry login
  kamal registry            # Login and -out of the image registry
  kamal remove              # Remove kamal-proxy, app, accessories, and registry session from servers
  kamal rollback [VERSION]  # Rollback app to VERSION
  kamal secrets             # Helpers for extracting secrets
  kamal server              # Bootstrap servers with curl and Docker
  kamal setup               # Setup all accessories, push the env, and deploy app to servers
  kamal upgrade             # Upgrade from Kamal 1.x to 2.0
  kamal version             # Show Kamal version
```

4fd060b96d
2024-11-21 20:41:30 +00:00
David Rodríguez
155989415b [rubygems/rubygems] Avoid now unnecessary reset
511c7b211b
2024-09-09 08:46:02 +00:00
David Rodríguez
72e80c8f29 [rubygems/rubygems] Make gem exec use the standard GEM_HOME
032b3c518a
2024-09-09 08:46:01 +00:00
Hiroshi SHIBATA
f24a86d83f util/rubocop -A --only Layout/EmptyLineAfterMagicComment 2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA
05208c3875 [rubygems/rubygems] util/rubocop -A --only Lint/UnusedBlockArgument
d8efd919db
2023-03-17 18:50:55 +09:00
Samuel Giddins
2d6097a0f5 [rubygems/rubygems] Fix method redefinition warning in gem exec specs
f177990d4c
2023-02-28 12:54:37 +00:00
Samuel Giddins
a17b1b19b1 [rubygems/rubygems] Always join with a string
Gem.path_separator can also be a regexp...

7e6e56a5f3
2023-02-22 08:42:20 +00:00
Samuel Giddins
0ca3a095be [rubygems/rubygems] Only update env if var exists
Will save on an error if it would be nil from an exception happening during that line

d6797a04e9
2023-02-22 08:42:19 +00:00
Samuel Giddins
80bfa1b30a [rubygems/rubygems] Fix resetting env in gem exec, and make sure it is set for gem exec gem
13a6dd4992
2023-02-22 08:42:18 +00:00
Samuel Giddins
2dd9698350 [rubygems/rubygems] Allow gem exec gem
a767f7b9be
2023-02-22 08:42:17 +00:00
Samuel Giddins
47d4f73ee7 [rubygems/rubygems] Remove platform option for gem exec
Also fix native extensions that load dependencies

a06f9870c7
2023-02-22 08:42:17 +00:00
Samuel Giddins
612ebd10c0 [rubygems/rubygems] Ensure dependencies are updated by default when running gem exec
664f3e1e5f
2023-02-22 08:42:16 +00:00
Samuel Giddins
3f0f9a7942 [rubygems/rubygems] Add gem exec description
dac1609fd5
2023-02-22 08:42:16 +00:00
Samuel Giddins
d81be0609b [rubygems/rubygems] Add specs for gem exec
3078e5834e
2023-02-22 08:42:16 +00:00
Samuel Giddins
cbe14cc8e6 [rubygems/rubygems] Add gem exec command
ca69a317f3
2023-02-22 08:42:15 +00:00