From f0f7ab8354702a0b2f019d0791ba1c778268428d Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Mon, 8 Jan 2024 13:28:09 -0800 Subject: [PATCH] Remove ActiveSupport String indent core extension --- .gitignore | 1 - Library/Homebrew/global.rb | 1 - .../active_support/core_ext/string/indent.rb | 45 ------------------- 3 files changed, 47 deletions(-) delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/core_ext/string/indent.rb diff --git a/.gitignore b/.gitignore index ea397973de4445..459a668d06ee09 100644 --- a/.gitignore +++ b/.gitignore @@ -72,7 +72,6 @@ !**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/core_ext/object/deep_dup.rb !**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/core_ext/object/duplicable.rb !**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/core_ext/string/exclude.rb -!**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/core_ext/string/indent.rb # Ignore partially included gems where we don't need all files **/vendor/gems/mechanize-*/.* diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index fb76398eebbb6c..691f5a3f983b4c 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -18,7 +18,6 @@ require "active_support/core_ext/hash/deep_merge" require "active_support/core_ext/hash/keys" require "active_support/core_ext/string/exclude" -require "active_support/core_ext/string/indent" HOMEBREW_API_DEFAULT_DOMAIN = ENV.fetch("HOMEBREW_API_DEFAULT_DOMAIN").freeze HOMEBREW_BOTTLE_DEFAULT_DOMAIN = ENV.fetch("HOMEBREW_BOTTLE_DEFAULT_DOMAIN").freeze diff --git a/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/core_ext/string/indent.rb b/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/core_ext/string/indent.rb deleted file mode 100644 index af9d181487eb16..00000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/core_ext/string/indent.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -class String - # Same as +indent+, except it indents the receiver in-place. - # - # Returns the indented string, or +nil+ if there was nothing to indent. - def indent!(amount, indent_string = nil, indent_empty_lines = false) - indent_string = indent_string || self[/^[ \t]/] || " " - re = indent_empty_lines ? /^/ : /^(?!$)/ - gsub!(re, indent_string * amount) - end - - # Indents the lines in the receiver: - # - # < - # def some_method - # some_code - # end - # - # The second argument, +indent_string+, specifies which indent string to - # use. The default is +nil+, which tells the method to make a guess by - # peeking at the first indented line, and fallback to a space if there is - # none. - # - # " foo".indent(2) # => " foo" - # "foo\n\t\tbar".indent(2) # => "\t\tfoo\n\t\t\t\tbar" - # "foo".indent(2, "\t") # => "\t\tfoo" - # - # While +indent_string+ is typically one space or tab, it may be any string. - # - # The third argument, +indent_empty_lines+, is a flag that says whether - # empty lines should be indented. Default is false. - # - # "foo\n\nbar".indent(2) # => " foo\n\n bar" - # "foo\n\nbar".indent(2, nil, true) # => " foo\n \n bar" - # - def indent(amount, indent_string = nil, indent_empty_lines = false) - dup.tap { |_| _.indent!(amount, indent_string, indent_empty_lines) } - end -end