Skip to content

Commit 9934845

Browse files
Merge pull request #8919 from rubygems/deivid-rodriguez/improve-cli-documentation
Improve documentation of `bundle doctor`, `bundle plugin`, and `bundle config`
2 parents dd55779 + 6746ef2 commit 9934845

39 files changed

+258
-196
lines changed

bundler/lib/bundler/cli.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -520,11 +520,11 @@ def licenses
520520
Viz requires the ruby-graphviz gem (and its dependencies).
521521
The associated gems must also be installed via 'bundle install'.
522522
D
523-
method_option :file, type: :string, default: "gem_graph", aliases: "-f", desc: "The name to use for the generated file. see format option"
524-
method_option :format, type: :string, default: "png", aliases: "-F", desc: "This is output format option. Supported format is png, jpg, svg, dot ..."
525-
method_option :requirements, type: :boolean, default: false, aliases: "-R", desc: "Set to show the version of each required dependency."
526-
method_option :version, type: :boolean, default: false, aliases: "-v", desc: "Set to show each gem version."
527-
method_option :without, type: :array, default: [], aliases: "-W", banner: "GROUP[ GROUP...]", desc: "Exclude gems that are part of the specified named group."
523+
method_option :file, type: :string, default: "gem_graph", aliases: "-f", banner: "The name to use for the generated file. see format option"
524+
method_option :format, type: :string, default: "png", aliases: "-F", banner: "This is output format option. Supported format is png, jpg, svg, dot ..."
525+
method_option :requirements, type: :boolean, default: false, aliases: "-R", banner: "Set to show the version of each required dependency."
526+
method_option :version, type: :boolean, default: false, aliases: "-v", banner: "Set to show each gem version."
527+
method_option :without, type: :array, default: [], aliases: "-W", banner: "Exclude gems that are part of the specified named group."
528528
def viz
529529
SharedHelpers.major_deprecation 2, "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
530530
require_relative "cli/viz"
@@ -533,19 +533,19 @@ def viz
533533
end
534534

535535
desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
536-
method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], desc: "Generate a binary executable for your library."
537-
method_option :coc, type: :boolean, desc: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
538-
method_option :edit, type: :string, aliases: "-e", required: false, banner: "EDITOR", lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, desc: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
539-
method_option :ext, type: :string, desc: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
540-
method_option :git, type: :boolean, default: true, desc: "Initialize a git repo inside your library."
541-
method_option :mit, type: :boolean, desc: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
542-
method_option :rubocop, type: :boolean, desc: "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
543-
method_option :changelog, type: :boolean, desc: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
536+
method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], banner: "Generate a binary executable for your library."
537+
method_option :coc, type: :boolean, banner: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
538+
method_option :edit, type: :string, aliases: "-e", required: false, lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, banner: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
539+
method_option :ext, type: :string, banner: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
540+
method_option :git, type: :boolean, default: true, banner: "Initialize a git repo inside your library."
541+
method_option :mit, type: :boolean, banner: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
542+
method_option :rubocop, type: :boolean, banner: "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
543+
method_option :changelog, type: :boolean, banner: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
544544
method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library", enum: %w[rspec minitest test-unit], desc: "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
545-
method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], desc: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
546-
method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], desc: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
545+
method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], banner: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
546+
method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], banner: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
547547
method_option :github_username, type: :string, default: Bundler.settings["gem.github_username"], banner: "Set your username on GitHub", desc: "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
548-
method_option :bundle, type: :boolean, default: Bundler.settings["gem.bundle"], desc: "Automatically run `bundle install` after creation. Set a default with `bundle config set --global gem.bundle true`"
548+
method_option :bundle, type: :boolean, default: Bundler.settings["gem.bundle"], banner: "Automatically run `bundle install` after creation. Set a default with `bundle config set --global gem.bundle true`"
549549

550550
def gem(name)
551551
require_relative "cli/gem"

bundler/lib/bundler/man/bundle-add.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-ADD" "1" "July 2025" ""
3+
.TH "BUNDLE\-ADD" "1" "August 2025" ""
44
.SH "NAME"
55
\fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-binstubs.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-BINSTUBS" "1" "July 2025" ""
3+
.TH "BUNDLE\-BINSTUBS" "1" "August 2025" ""
44
.SH "NAME"
55
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-cache.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CACHE" "1" "July 2025" ""
3+
.TH "BUNDLE\-CACHE" "1" "August 2025" ""
44
.SH "NAME"
55
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-check.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CHECK" "1" "July 2025" ""
3+
.TH "BUNDLE\-CHECK" "1" "August 2025" ""
44
.SH "NAME"
55
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-clean.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CLEAN" "1" "July 2025" ""
3+
.TH "BUNDLE\-CLEAN" "1" "August 2025" ""
44
.SH "NAME"
55
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-config.1

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CONFIG" "1" "July 2025" ""
3+
.TH "BUNDLE\-CONFIG" "1" "August 2025" ""
44
.SH "NAME"
55
\fBbundle\-config\fR \- Set bundler configuration options
66
.SH "SYNOPSIS"
7-
\fBbundle config\fR list
7+
\fBbundle config\fR [list]
88
.br
9-
\fBbundle config\fR [get] NAME
9+
\fBbundle config\fR [get [\-\-local|\-\-global]] NAME
1010
.br
11-
\fBbundle config\fR [set] NAME VALUE
11+
\fBbundle config\fR [set [\-\-local|\-\-global]] NAME VALUE
1212
.br
13-
\fBbundle config\fR unset NAME
13+
\fBbundle config\fR unset [\-\-local|\-\-global] NAME
1414
.SH "DESCRIPTION"
1515
This command allows you to interact with Bundler's configuration system\.
1616
.P
@@ -25,23 +25,40 @@ Global config (\fB~/\.bundle/config\fR)
2525
Bundler default config
2626
.IP "" 0
2727
.P
28+
Executing \fBbundle\fR with the \fBBUNDLE_IGNORE_CONFIG\fR environment variable set will cause it to ignore all configuration\.
29+
.SH "SUB\-COMMANDS"
30+
.SS "list (default command)"
2831
Executing \fBbundle config list\fR will print a list of all bundler configuration for the current bundle, and where that configuration was set\.
32+
.SS "get"
33+
Executing \fBbundle config get <name>\fR will print the value of that configuration setting, and all locations where it was set\.
2934
.P
30-
Executing \fBbundle config get <name>\fR will print the value of that configuration setting, and where it was set\.
31-
.P
32-
Executing \fBbundle config set <name> <value>\fR defaults to setting \fBlocal\fR configuration if executing from within a local application, otherwise it will set \fBglobal\fR configuration\. See \fB\-\-local\fR and \fB\-\-global\fR options below\.
35+
\fBOPTIONS\fR
36+
.TP
37+
\fB\-\-local\fR
38+
Get configuration from configuration file for the local application, namely, \fB<project_root>/\.bundle/config\fR, or \fB$BUNDLE_APP_CONFIG/config\fR if \fBBUNDLE_APP_CONFIG\fR is set\.
39+
.TP
40+
\fB\-\-global\fR
41+
Get configuration from configuration file global to all bundles executed as the current user, namely, from \fB~/\.bundle/config\fR\.
42+
.SS "set"
43+
Executing \fBbundle config set <name> <value>\fR defaults to setting \fBlocal\fR configuration if executing from within a local application, otherwise it will set \fBglobal\fR configuration\.
3344
.P
45+
\fBOPTIONS\fR
46+
.TP
47+
\fB\-\-local\fR
3448
Executing \fBbundle config set \-\-local <name> <value>\fR will set that configuration in the directory for the local application\. The configuration will be stored in \fB<project_root>/\.bundle/config\fR\. If \fBBUNDLE_APP_CONFIG\fR is set, the configuration will be stored in \fB$BUNDLE_APP_CONFIG/config\fR\.
35-
.P
49+
.TP
50+
\fB\-\-global\fR
3651
Executing \fBbundle config set \-\-global <name> <value>\fR will set that configuration to the value specified for all bundles executed as the current user\. The configuration will be stored in \fB~/\.bundle/config\fR\. If \fIname\fR already is set, \fIname\fR will be overridden and user will be warned\.
37-
.P
52+
.SS "unset"
3853
Executing \fBbundle config unset <name>\fR will delete the configuration in both local and global sources\.
3954
.P
40-
Executing \fBbundle config unset \-\-global <name>\fR will delete the configuration only from the user configuration\.
41-
.P
55+
\fBOPTIONS\fR
56+
.TP
57+
\fB\-\-local\fR
4258
Executing \fBbundle config unset \-\-local <name>\fR will delete the configuration only from the local application\.
43-
.P
44-
Executing bundle with the \fBBUNDLE_IGNORE_CONFIG\fR environment variable set will cause it to ignore all configuration\.
59+
.TP
60+
\fB\-\-global\fR
61+
Executing \fBbundle config unset \-\-global <name>\fR will delete the configuration only from the user configuration\.
4562
.SH "CONFIGURATION KEYS"
4663
Configuration keys in bundler have two forms: the canonical form and the environment variable form\.
4764
.P

bundler/lib/bundler/man/bundle-config.1.ronn

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ bundle-config(1) -- Set bundler configuration options
33

44
## SYNOPSIS
55

6-
`bundle config` list<br>
7-
`bundle config` [get] NAME<br>
8-
`bundle config` [set] NAME VALUE<br>
9-
`bundle config` unset NAME
6+
`bundle config` [list]<br>
7+
`bundle config` [get [--local|--global]] NAME<br>
8+
`bundle config` [set [--local|--global]] NAME VALUE<br>
9+
`bundle config` unset [--local|--global] NAME
1010

1111
## DESCRIPTION
1212

@@ -19,38 +19,67 @@ Bundler loads configuration settings in this order:
1919
3. Global config (`~/.bundle/config`)
2020
4. Bundler default config
2121

22+
Executing `bundle` with the `BUNDLE_IGNORE_CONFIG` environment variable set will
23+
cause it to ignore all configuration.
24+
25+
## SUB-COMMANDS
26+
27+
### list (default command)
28+
2229
Executing `bundle config list` will print a list of all bundler
2330
configuration for the current bundle, and where that configuration
2431
was set.
2532

33+
### get
34+
2635
Executing `bundle config get <name>` will print the value of that configuration
27-
setting, and where it was set.
36+
setting, and all locations where it was set.
37+
38+
**OPTIONS**
39+
40+
* `--local`:
41+
Get configuration from configuration file for the local application, namely,
42+
`<project_root>/.bundle/config`, or `$BUNDLE_APP_CONFIG/config` if
43+
`BUNDLE_APP_CONFIG` is set.
44+
45+
* `--global`:
46+
Get configuration from configuration file global to all bundles executed as
47+
the current user, namely, from `~/.bundle/config`.
48+
49+
### set
2850

2951
Executing `bundle config set <name> <value>` defaults to setting `local`
3052
configuration if executing from within a local application, otherwise it will
31-
set `global` configuration. See `--local` and `--global` options below.
53+
set `global` configuration.
3254

33-
Executing `bundle config set --local <name> <value>` will set that configuration
34-
in the directory for the local application. The configuration will be stored in
35-
`<project_root>/.bundle/config`. If `BUNDLE_APP_CONFIG` is set, the configuration
36-
will be stored in `$BUNDLE_APP_CONFIG/config`.
55+
**OPTIONS**
3756

38-
Executing `bundle config set --global <name> <value>` will set that
39-
configuration to the value specified for all bundles executed as the current
40-
user. The configuration will be stored in `~/.bundle/config`. If <name> already
41-
is set, <name> will be overridden and user will be warned.
57+
* `--local`:
58+
Executing `bundle config set --local <name> <value>` will set that configuration
59+
in the directory for the local application. The configuration will be stored in
60+
`<project_root>/.bundle/config`. If `BUNDLE_APP_CONFIG` is set, the configuration
61+
will be stored in `$BUNDLE_APP_CONFIG/config`.
62+
63+
* `--global`:
64+
Executing `bundle config set --global <name> <value>` will set that
65+
configuration to the value specified for all bundles executed as the current
66+
user. The configuration will be stored in `~/.bundle/config`. If <name> already
67+
is set, <name> will be overridden and user will be warned.
68+
69+
### unset
4270

4371
Executing `bundle config unset <name>` will delete the configuration in both
4472
local and global sources.
4573

46-
Executing `bundle config unset --global <name>` will delete the configuration
47-
only from the user configuration.
74+
**OPTIONS**
4875

49-
Executing `bundle config unset --local <name>` will delete the configuration
50-
only from the local application.
76+
* `--local`:
77+
Executing `bundle config unset --local <name>` will delete the configuration
78+
only from the local application.
5179

52-
Executing bundle with the `BUNDLE_IGNORE_CONFIG` environment variable set will
53-
cause it to ignore all configuration.
80+
* `--global`:
81+
Executing `bundle config unset --global <name>` will delete the configuration
82+
only from the user configuration.
5483

5584
## CONFIGURATION KEYS
5685

bundler/lib/bundler/man/bundle-console.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CONSOLE" "1" "July 2025" ""
3+
.TH "BUNDLE\-CONSOLE" "1" "August 2025" ""
44
.SH "NAME"
55
\fBbundle\-console\fR \- Open an IRB session with the bundle pre\-loaded
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-doctor.1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-DOCTOR" "1" "July 2025" ""
3+
.TH "BUNDLE\-DOCTOR" "1" "August 2025" ""
44
.SH "NAME"
55
\fBbundle\-doctor\fR \- Checks the bundle for common problems
66
.SH "SYNOPSIS"
77
\fBbundle doctor [diagnose]\fR [\-\-quiet] [\-\-gemfile=GEMFILE] [\-\-ssl]
88
.br
9-
\fBbundle doctor ssl\fR [\-\-host=HOST] [\-\-tls\-version=VERSION] [\-\-verify\-mode=MODE]
9+
\fBbundle doctor ssl\fR [\-\-host=HOST] [\-\-tls\-version=TLS\-VERSION] [\-\-verify\-mode=VERIFY\-MODE]
1010
.br
1111
\fBbundle doctor\fR help [COMMAND]
1212
.SH "DESCRIPTION"
@@ -57,12 +57,12 @@ Open a TLS connection and verify the outcome\.
5757
\fB\-\-host=HOST\fR
5858
Perform the diagnostic on HOST\. Defaults to \fBrubygems\.org\fR\.
5959
.TP
60-
\fB\-\-tls\-version=VERSION\fR
60+
\fB\-\-tls\-version=TLS\-VERSION\fR
6161
Specify the TLS version when opening the connection to HOST\.
6262
.IP
6363
Accepted values are: \fB1\.1\fR or \fB1\.2\fR\.
6464
.TP
65-
\fB\-\-verify\-mode=MODE\fR
65+
\fB\-\-verify\-mode=VERIFY\-MODE\fR
6666
Specify the TLS verify mode when opening the connection to HOST\. Defaults to \fBSSL_VERIFY_PEER\fR\.
6767
.IP
6868
Accepted values are: \fBCLIENT_ONCE\fR, \fBFAIL_IF_NO_PEER_CERT\fR, \fBNONE\fR, \fBPEER\fR\.

0 commit comments

Comments
 (0)