From e94d3767e63bd697a95396dcf4094a964b7f4ceb Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Fri, 3 Mar 2023 12:43:15 -0800 Subject: [PATCH] Add rails license --- Library/Homebrew/extend/array.rb | 21 +++++++++++++++++++ Library/Homebrew/rubocops/components_order.rb | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/extend/array.rb b/Library/Homebrew/extend/array.rb index 21b282a6f5..2c2d1dfa71 100644 --- a/Library/Homebrew/extend/array.rb +++ b/Library/Homebrew/extend/array.rb @@ -27,6 +27,27 @@ class Array # # => "one or two or at least three" # @see https://github.com/rails/rails/blob/v7.0.4.2/activesupport/lib/active_support/core_ext/array/conversions.rb#L8-L84 # ActiveSupport Array#to_sentence monkey-patch + # + # Copyright (c) David Heinemeier Hansson + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + # 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 ") case length when 0 diff --git a/Library/Homebrew/rubocops/components_order.rb b/Library/Homebrew/rubocops/components_order.rb index dbc8463a02..4661aed6fa 100644 --- a/Library/Homebrew/rubocops/components_order.rb +++ b/Library/Homebrew/rubocops/components_order.rb @@ -75,8 +75,8 @@ module RuboCop [:url, :version, :sha256], [:url, :mirror, :version, :sha256], ] - minimum_methods = ::Utils.to_sentence(allowed_methods.first.map { |m| "`#{m}`" }) - maximum_methods = ::Utils.to_sentence(allowed_methods.last.map { |m| "`#{m}`" }) + minimum_methods = allowed_methods.first.map { |m| "`#{m}`" }.to_sentence + maximum_methods = allowed_methods.last.map { |m| "`#{m}`" }.to_sentence on_system_bodies.each do |on_system_block, on_system_body| method_name = on_system_block.method_name