summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2024-12-10 14:11:02 +0100
committergit <[email protected]>2024-12-11 17:56:20 +0000
commit06f074eb5c8391a8694fdadbe5201cbb7d083117 (patch)
treed1978e6bbfa165779193cfc9288783225abf91c6 /lib
parent13530af05a5783173d09c50da20539171c79fb5e (diff)
[rubygems/rubygems] Style CLI options consistently
In one liners, no whitespace for alignment. https://github.com/rubygems/rubygems/commit/413339a9ca
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli.rb32
1 files changed, 9 insertions, 23 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 89318045ba..a469cf23e1 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -217,7 +217,7 @@ module Bundler
method_option "full-index", type: :boolean, banner: "Fall back to using the single-file index of all gems"
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
- method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
+ method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
@@ -227,10 +227,8 @@ module Bundler
method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default (usually 'ruby')"
method_option "standalone", type: :array, lazy_default: [], banner: "Make a bundle that can work without the Bundler runtime"
method_option "system", type: :boolean, banner: "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
- method_option "trust-policy", alias: "P", type: :string, banner: "Gem trust policy (like gem install -P). Must be one of " +
- Bundler.rubygems.security_policy_keys.join("|")
+ method_option "trust-policy", alias: "P", type: :string, banner: "Gem trust policy (like gem install -P). Must be one of #{Bundler.rubygems.security_policy_keys.join("|")}"
method_option "target-rbconfig", type: :string, banner: "rbconfig.rb for the deployment target platform"
-
method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group."
method_option "with", type: :array, banner: "Include gems that are part of the specified named group."
def install
@@ -288,10 +286,8 @@ module Bundler
Show lists the names and versions of all gems that are required by your Gemfile.
Calling show with [GEM] will list the exact location of that gem on your machine.
D
- method_option "paths", type: :boolean,
- banner: "List the paths of all gems that are required by your Gemfile."
- method_option "outdated", type: :boolean,
- banner: "Show verbose output including whether gems are outdated."
+ method_option "paths", type: :boolean, banner: "List the paths of all gems that are required by your Gemfile."
+ method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated."
def show(gem_name = nil)
if ARGV.include?("--outdated")
message = "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement"
@@ -400,9 +396,7 @@ module Bundler
end
desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
- method_option "all", type: :boolean,
- default: Bundler.feature_flag.cache_all?,
- banner: "Include all sources (including path and git)."
+ method_option "all", type: :boolean, default: Bundler.feature_flag.cache_all?, banner: "Include all sources (including path and git)."
method_option "all-platforms", type: :boolean, banner: "Include gems for all platforms present in the lockfile, not only the current one"
method_option "cache-path", type: :string, banner: "Specify a different cache path than the default (vendor/cache)."
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
@@ -540,23 +534,15 @@ module Bundler
desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], desc: "Generate a binary executable for your library."
method_option :coc, type: :boolean, desc: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
- 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)"
+ 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)"
method_option :ext, type: :string, desc: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
method_option :git, type: :boolean, default: true, desc: "Initialize a git repo inside your library."
method_option :mit, type: :boolean, desc: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
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`."
method_option :changelog, type: :boolean, desc: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
- 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)`."
- 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)`"
- 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)`"
+ 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)`."
+ 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)`"
+ 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)`"
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>`."
def gem(name)