2024-03-21 10:25:16 -07:00
|
|
|
# typed: strict
|
2019-11-21 19:50:23 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-03-21 10:39:08 -07:00
|
|
|
require "abstract_command"
|
2019-11-21 19:50:23 +00:00
|
|
|
|
|
|
|
module Homebrew
|
2024-03-21 10:25:16 -07:00
|
|
|
module DevCmd
|
|
|
|
class InstallBundlerGems < AbstractCommand
|
|
|
|
cmd_args do
|
|
|
|
description <<~EOS
|
|
|
|
Install Homebrew's Bundler gems.
|
|
|
|
EOS
|
|
|
|
comma_array "--groups",
|
|
|
|
description: "Installs the specified comma-separated list of gem groups (default: last used). " \
|
|
|
|
"Replaces any previously installed groups."
|
|
|
|
comma_array "--add-groups",
|
|
|
|
description: "Installs the specified comma-separated list of gem groups, " \
|
|
|
|
"in addition to those already installed."
|
|
|
|
|
|
|
|
conflicts "--groups", "--add-groups"
|
|
|
|
|
|
|
|
named_args :none
|
|
|
|
end
|
|
|
|
|
|
|
|
sig { override.void }
|
|
|
|
def run
|
|
|
|
groups = args.groups || args.add_groups || []
|
|
|
|
|
|
|
|
if groups.delete("all")
|
|
|
|
groups |= Homebrew.valid_gem_groups
|
|
|
|
elsif args.groups # if we have been asked to replace
|
|
|
|
Homebrew.forget_user_gem_groups!
|
|
|
|
end
|
|
|
|
|
|
|
|
Homebrew.install_bundler_gems!(groups:)
|
|
|
|
end
|
2019-11-21 19:50:23 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|