Port Homebrew::DevCmd::InstallBundlerGems
This commit is contained in:
		
							parent
							
								
									485574ac98
								
							
						
					
					
						commit
						0e489a8c04
					
				@ -11,6 +11,7 @@ module Homebrew
 | 
			
		||||
  module DevCmd
 | 
			
		||||
    class GenerateManCompletions < AbstractCommand
 | 
			
		||||
      include SystemCommand::Mixin
 | 
			
		||||
 | 
			
		||||
      cmd_args do
 | 
			
		||||
        description <<~EOS
 | 
			
		||||
          Generate Homebrew's manpages and shell completions.
 | 
			
		||||
 | 
			
		||||
@ -1,14 +1,12 @@
 | 
			
		||||
# typed: true
 | 
			
		||||
# typed: strict
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
require "cli/parser"
 | 
			
		||||
 | 
			
		||||
module Homebrew
 | 
			
		||||
  module_function
 | 
			
		||||
 | 
			
		||||
  sig { returns(CLI::Parser) }
 | 
			
		||||
  def install_bundler_gems_args
 | 
			
		||||
    Homebrew::CLI::Parser.new do
 | 
			
		||||
  module DevCmd
 | 
			
		||||
    class InstallBundlerGems < AbstractCommand
 | 
			
		||||
      cmd_args do
 | 
			
		||||
        description <<~EOS
 | 
			
		||||
          Install Homebrew's Bundler gems.
 | 
			
		||||
        EOS
 | 
			
		||||
@ -23,11 +21,9 @@ module Homebrew
 | 
			
		||||
 | 
			
		||||
        named_args :none
 | 
			
		||||
      end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def install_bundler_gems
 | 
			
		||||
    args = install_bundler_gems_args.parse
 | 
			
		||||
 | 
			
		||||
      sig { override.void }
 | 
			
		||||
      def run
 | 
			
		||||
        groups = args.groups || args.add_groups || []
 | 
			
		||||
 | 
			
		||||
        if groups.delete("all")
 | 
			
		||||
@ -38,4 +34,6 @@ module Homebrew
 | 
			
		||||
 | 
			
		||||
        Homebrew.install_bundler_gems!(groups:)
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,8 @@
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
require "cmd/shared_examples/args_parse"
 | 
			
		||||
require "dev-cmd/install-bundler-gems"
 | 
			
		||||
 | 
			
		||||
RSpec.describe Homebrew::DevCmd::InstallBundlerGems do
 | 
			
		||||
  it_behaves_like "parseable arguments"
 | 
			
		||||
end
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user