diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index 16f39a3c1b..444da12f15 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "formula" -require "ostruct" require "cli/parser" require "cask/caskroom" require "dependencies_helpers" diff --git a/Library/Homebrew/cmd/link.rb b/Library/Homebrew/cmd/link.rb index d52f4c5f3a..9bacec52f3 100644 --- a/Library/Homebrew/cmd/link.rb +++ b/Library/Homebrew/cmd/link.rb @@ -1,7 +1,6 @@ # typed: true # frozen_string_literal: true -require "ostruct" require "caveats" require "cli/parser" require "unlink" diff --git a/Library/Homebrew/cmd/unlink.rb b/Library/Homebrew/cmd/unlink.rb index 605adfbf22..5034b6a2a7 100644 --- a/Library/Homebrew/cmd/unlink.rb +++ b/Library/Homebrew/cmd/unlink.rb @@ -1,7 +1,6 @@ # typed: true # frozen_string_literal: true -require "ostruct" require "cli/parser" require "unlink" diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb index a4620bc159..9b77b71723 100644 --- a/Library/Homebrew/cmd/uses.rb +++ b/Library/Homebrew/cmd/uses.rb @@ -9,6 +9,7 @@ require "formula" require "cli/parser" require "cask/caskroom" require "dependencies_helpers" +require "ostruct" module Homebrew extend T::Sig diff --git a/Library/Homebrew/dev-cmd/generate-man-completions.rb b/Library/Homebrew/dev-cmd/generate-man-completions.rb index 1732a7a445..8c48755473 100644 --- a/Library/Homebrew/dev-cmd/generate-man-completions.rb +++ b/Library/Homebrew/dev-cmd/generate-man-completions.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "formula" -require "ostruct" require "completions" require "manpages" diff --git a/Library/Homebrew/extend/array.rb b/Library/Homebrew/extend/array.rb index 2c2d1dfa71..2755ee92bf 100644 --- a/Library/Homebrew/extend/array.rb +++ b/Library/Homebrew/extend/array.rb @@ -48,7 +48,7 @@ class Array # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - def to_sentence(words_connector: ", ", two_words_connector: " and ", last_word_connector: ", and ") + def to_sentence(words_connector: ", ", two_words_connector: " and ", last_word_connector: " and ") case length when 0 +"" diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index d1e6a96da4..1f87b4c3a9 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -7,8 +7,8 @@ require "English" require "fileutils" require "json" require "json/add/exception" -require "ostruct" require "forwardable" +require "set" # Only require "core_ext" here to ensure we're only requiring the minimum of # what we need. @@ -16,7 +16,6 @@ require "active_support/core_ext/object/blank" require "active_support/core_ext/string/filters" require "active_support/core_ext/object/try" require "active_support/core_ext/array/access" -require "i18n" require "active_support/core_ext/hash/except" require "active_support/core_ext/kernel/reporting" require "active_support/core_ext/hash/keys" @@ -26,9 +25,6 @@ require "active_support/core_ext/enumerable" require "active_support/core_ext/string/exclude" require "active_support/core_ext/string/indent" -I18n.backend.available_locales # Initialize locales so they can be overwritten. -I18n.backend.store_translations :en, support: { array: { last_word_connector: " and " } } - HOMEBREW_API_DEFAULT_DOMAIN = ENV.fetch("HOMEBREW_API_DEFAULT_DOMAIN").freeze HOMEBREW_BOTTLE_DEFAULT_DOMAIN = ENV.fetch("HOMEBREW_BOTTLE_DEFAULT_DOMAIN").freeze HOMEBREW_BREW_DEFAULT_GIT_REMOTE = ENV.fetch("HOMEBREW_BREW_DEFAULT_GIT_REMOTE").freeze @@ -148,8 +144,6 @@ rescue nil end.compact.freeze -require "set" - require "system_command" require "exceptions" require "utils" diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index cb19e3af11..f878f60f83 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -4,7 +4,6 @@ require "keg_relocate" require "language/python" require "lock_file" -require "ostruct" require "extend/cachable" # Installation prefix of a formula. diff --git a/Library/Homebrew/manpages.rb b/Library/Homebrew/manpages.rb index c08c000ee4..42b91bc3ac 100644 --- a/Library/Homebrew/manpages.rb +++ b/Library/Homebrew/manpages.rb @@ -36,7 +36,6 @@ module Homebrew markup = build_man_page(quiet: quiet) convert_man_page(markup, TARGET_DOC_PATH/"Manpage.md") - markup = I18n.transliterate(markup, locale: :en) convert_man_page(markup, TARGET_MAN_PATH/"brew.1") end diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb index 3ddd2a039b..e069a4e27f 100644 --- a/Library/Homebrew/system_command.rb +++ b/Library/Homebrew/system_command.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "open3" -require "ostruct" require "plist" require "shellwords" diff --git a/Library/Homebrew/test/extend/array_spec.rb b/Library/Homebrew/test/extend/array_spec.rb index 876cf90494..7d422389ad 100644 --- a/Library/Homebrew/test/extend/array_spec.rb +++ b/Library/Homebrew/test/extend/array_spec.rb @@ -9,12 +9,12 @@ describe Array do expect([].to_sentence).to eq("") expect(["one"].to_sentence).to eq("one") expect(["one", "two"].to_sentence).to eq("one and two") - expect(["one", "two", "three"].to_sentence).to eq("one, two, and three") + expect(["one", "two", "three"].to_sentence).to eq("one, two and three") end it "converts an array to a sentence with a custom connector" do - expect(["one", "two", "three"].to_sentence(words_connector: " ")).to eq("one two, and three") - expect(["one", "two", "three"].to_sentence(words_connector: " & ")).to eq("one & two, and three") + expect(["one", "two", "three"].to_sentence(words_connector: " ")).to eq("one two and three") + expect(["one", "two", "three"].to_sentence(words_connector: " & ")).to eq("one & two and three") end it "converts an array to a sentence with a custom last word connector" do @@ -38,7 +38,7 @@ describe Array do end it "converts an array with blank elements to a sentence" do - expect([nil, "one", "", "two", "three"].to_sentence).to eq(", one, , two, and three") + expect([nil, "one", "", "two", "three"].to_sentence).to eq(", one, , two and three") end it "does not return a frozen string" do diff --git a/Library/Homebrew/test/global_spec.rb b/Library/Homebrew/test/global_spec.rb index 6c34ca8838..a8469f9b58 100644 --- a/Library/Homebrew/test/global_spec.rb +++ b/Library/Homebrew/test/global_spec.rb @@ -8,4 +8,14 @@ describe "brew", :integration_test do .and not_to_output.to_stderr .and be_a_success end + + it "does not require i18n" do + # This is a transitive dependency of activesupport, but we don't use it. + expect { I18n }.to raise_error(NameError) + end + + it "does not require ActiveSupport::Inflector" do + # ActiveSupport inflections are slow to load, so we don't use them. + expect { ActiveSupport::Inflector }.to raise_error(NameError) + end end diff --git a/Library/Homebrew/test/rubocops/components_order_spec.rb b/Library/Homebrew/test/rubocops/components_order_spec.rb index cc1dd2f3a1..afead946d0 100644 --- a/Library/Homebrew/test/rubocops/components_order_spec.rb +++ b/Library/Homebrew/test/rubocops/components_order_spec.rb @@ -1014,7 +1014,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do resource do on_macos do - ^^^^^^^^^^^ `on_macos` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version`, and `sha256` (in order). + ^^^^^^^^^^^ `on_macos` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version` and `sha256` (in order). sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" url "https://brew.sh/resource2.tar.gz" end @@ -1081,7 +1081,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do resource do on_macos do - ^^^^^^^^^^^ `on_macos` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version`, and `sha256` (in order). + ^^^^^^^^^^^ `on_macos` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version` and `sha256` (in order). if foo == :bar url "https://brew.sh/resource2.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -1112,7 +1112,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_arm do - ^^^^^^^^^ `on_arm` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version`, and `sha256` (in order). + ^^^^^^^^^ `on_arm` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version` and `sha256` (in order). sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" url "https://brew.sh/resource2.tar.gz" end @@ -1158,7 +1158,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_arm do - ^^^^^^^^^ `on_arm` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version`, and `sha256` (in order). + ^^^^^^^^^ `on_arm` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version` and `sha256` (in order). if foo == :bar url "https://brew.sh/resource2.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index 63dfd274f2..9d88c13fab 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -542,7 +542,7 @@ __fish_brew_complete_arg 'contributions' -l debug -d 'Display any debugging info __fish_brew_complete_arg 'contributions' -l from -d 'Date (ISO-8601 format) to start searching contributions' __fish_brew_complete_arg 'contributions' -l help -d 'Show this message' __fish_brew_complete_arg 'contributions' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_arg 'contributions' -l repositories -d 'Specify a comma-separated (no spaces) list of repositories to search. Supported repositories: `brew`, `core`, `cask`, `aliases`, `autoupdate`, `bundle`, `command-not-found`, `test-bot`, `services`, `cask-drivers`, `cask-fonts`, and `cask-versions`. Omitting this flag, or specifying `--repositories=all`, searches all repositories. Use `--repositories=primary` to search only the main repositories: brew,core,cask' +__fish_brew_complete_arg 'contributions' -l repositories -d 'Specify a comma-separated (no spaces) list of repositories to search. Supported repositories: `brew`, `core`, `cask`, `aliases`, `autoupdate`, `bundle`, `command-not-found`, `test-bot`, `services`, `cask-drivers`, `cask-fonts` and `cask-versions`. Omitting this flag, or specifying `--repositories=all`, searches all repositories. Use `--repositories=primary` to search only the main repositories: brew,core,cask' __fish_brew_complete_arg 'contributions' -l to -d 'Date (ISO-8601 format) to stop searching contributions' __fish_brew_complete_arg 'contributions' -l user -d 'A GitHub username or email address of a specific person to find contribution data for' __fish_brew_complete_arg 'contributions' -l verbose -d 'Make some output more verbose' diff --git a/completions/zsh/_brew b/completions/zsh/_brew index 0d4f7437c9..6e14cc5711 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -671,7 +671,7 @@ _brew_contributions() { '--from[Date (ISO-8601 format) to start searching contributions]' \ '--help[Show this message]' \ '--quiet[Make some output more quiet]' \ - '--repositories[Specify a comma-separated (no spaces) list of repositories to search. Supported repositories: `brew`, `core`, `cask`, `aliases`, `autoupdate`, `bundle`, `command-not-found`, `test-bot`, `services`, `cask-drivers`, `cask-fonts`, and `cask-versions`. Omitting this flag, or specifying `--repositories=all`, searches all repositories. Use `--repositories=primary` to search only the main repositories: brew,core,cask]' \ + '--repositories[Specify a comma-separated (no spaces) list of repositories to search. Supported repositories: `brew`, `core`, `cask`, `aliases`, `autoupdate`, `bundle`, `command-not-found`, `test-bot`, `services`, `cask-drivers`, `cask-fonts` and `cask-versions`. Omitting this flag, or specifying `--repositories=all`, searches all repositories. Use `--repositories=primary` to search only the main repositories: brew,core,cask]' \ '--to[Date (ISO-8601 format) to stop searching contributions]' \ '--user[A GitHub username or email address of a specific person to find contribution data for]' \ '--verbose[Make some output more verbose]' diff --git a/docs/Manpage.md b/docs/Manpage.md index 8407854076..45fbf5ad7e 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -1116,7 +1116,7 @@ Display the path to the file being used when invoking `brew` *`cmd`*. Contributions to Homebrew repos. * `--repositories`: - Specify a comma-separated (no spaces) list of repositories to search. Supported repositories: `brew`, `core`, `cask`, `aliases`, `autoupdate`, `bundle`, `command-not-found`, `test-bot`, `services`, `cask-drivers`, `cask-fonts`, and `cask-versions`. Omitting this flag, or specifying `--repositories=all`, searches all repositories. Use `--repositories=primary` to search only the main repositories: brew,core,cask. + Specify a comma-separated (no spaces) list of repositories to search. Supported repositories: `brew`, `core`, `cask`, `aliases`, `autoupdate`, `bundle`, `command-not-found`, `test-bot`, `services`, `cask-drivers`, `cask-fonts` and `cask-versions`. Omitting this flag, or specifying `--repositories=all`, searches all repositories. Use `--repositories=primary` to search only the main repositories: brew,core,cask. * `--from`: Date (ISO-8601 format) to start searching contributions. * `--to`: diff --git a/manpages/brew.1 b/manpages/brew.1 index 487254d0e3..7bf8f0742e 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1603,7 +1603,7 @@ Contributions to Homebrew repos\. . .TP \fB\-\-repositories\fR -Specify a comma\-separated (no spaces) list of repositories to search\. Supported repositories: \fBbrew\fR, \fBcore\fR, \fBcask\fR, \fBaliases\fR, \fBautoupdate\fR, \fBbundle\fR, \fBcommand\-not\-found\fR, \fBtest\-bot\fR, \fBservices\fR, \fBcask\-drivers\fR, \fBcask\-fonts\fR, and \fBcask\-versions\fR\. Omitting this flag, or specifying \fB\-\-repositories=all\fR, searches all repositories\. Use \fB\-\-repositories=primary\fR to search only the main repositories: brew,core,cask\. +Specify a comma\-separated (no spaces) list of repositories to search\. Supported repositories: \fBbrew\fR, \fBcore\fR, \fBcask\fR, \fBaliases\fR, \fBautoupdate\fR, \fBbundle\fR, \fBcommand\-not\-found\fR, \fBtest\-bot\fR, \fBservices\fR, \fBcask\-drivers\fR, \fBcask\-fonts\fR and \fBcask\-versions\fR\. Omitting this flag, or specifying \fB\-\-repositories=all\fR, searches all repositories\. Use \fB\-\-repositories=primary\fR to search only the main repositories: brew,core,cask\. . .TP \fB\-\-from\fR @@ -3454,7 +3454,7 @@ Homebrew API: \fIhttps://rubydoc\.brew\.sh\fR Homebrew\'s Project Leader is Mike McQuaid\. . .P -Homebrew\'s Project Leadership Committee is Colin Dean, Issy Long, Jonathan Chang, Mike McQuaid, Misty De Meo, and Sean Molenaar\. +Homebrew\'s Project Leadership Committee is Colin Dean, Issy Long, Jonathan Chang, Mike McQuaid, Misty De Méo, and Sean Molenaar\. . .P Homebrew\'s Technical Steering Committee is Bo Anderson, FX Coudert, Michka Popoff, Mike McQuaid, and Rylan Polster\. @@ -3463,7 +3463,7 @@ Homebrew\'s Technical Steering Committee is Bo Anderson, FX Coudert, Michka Popo Homebrew\'s maintainers are Alexander Bayandin, Bevan Kay, Bo Anderson, Branch Vincent, Caleb Xu, Carlo Cabrera, Daniel Nachun, Dawid Dziurla, Dustin Rodrigues, Eric Knibbe, FX Coudert, George Adams, Issy Long, Markus Reiter, Miccal Matthews, Michael Cho, Michka Popoff, Mike McQuaid, Nanda H Krishna, Patrick Linnane, Rui Chen, Ruoyu Zhong, Rylan Polster, Sam Ford, Sean Molenaar, and Thierry Moisan\. . .P -Former maintainers with significant contributions include Misty De Meo, Shaun Jackman, Vitor Galvao, Claudia Pellegrino, Seeker, William Woodruff, Jan Viljanen, JCount, commitay, Dominyk Tiller, Tim Smith, Baptiste Fontaine, Xu Cheng, Martin Afanasjew, Brett Koonce, Charlie Sharpsteen, Jack Nagel, Adam Vandenberg, Andrew Janke, Alex Dunn, neutric, Tomasz Pajor, Uladzislau Shablinski, Alyssa Ross, ilovezfs, Chongyu Zhu and Homebrew\'s creator: Max Howell\. +Former maintainers with significant contributions include Misty De Méo, Shaun Jackman, Vítor Galvão, Claudia Pellegrino, Seeker, William Woodruff, Jan Viljanen, JCount, commitay, Dominyk Tiller, Tim Smith, Baptiste Fontaine, Xu Cheng, Martin Afanasjew, Brett Koonce, Charlie Sharpsteen, Jack Nagel, Adam Vandenberg, Andrew Janke, Alex Dunn, neutric, Tomasz Pajor, Uladzislau Shablinski, Alyssa Ross, ilovezfs, Chongyu Zhu and Homebrew\'s creator: Max Howell\. . .SH "BUGS" See our issues on GitHub: