Add rails license
This commit is contained in:
parent
317874c394
commit
e94d3767e6
@ -27,6 +27,27 @@ class Array
|
|||||||
# # => "one or two or at least three"
|
# # => "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
|
# @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
|
# 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 ")
|
def to_sentence(words_connector: ", ", two_words_connector: " and ", last_word_connector: ", and ")
|
||||||
case length
|
case length
|
||||||
when 0
|
when 0
|
||||||
|
|||||||
@ -75,8 +75,8 @@ module RuboCop
|
|||||||
[:url, :version, :sha256],
|
[:url, :version, :sha256],
|
||||||
[:url, :mirror, :version, :sha256],
|
[:url, :mirror, :version, :sha256],
|
||||||
]
|
]
|
||||||
minimum_methods = ::Utils.to_sentence(allowed_methods.first.map { |m| "`#{m}`" })
|
minimum_methods = allowed_methods.first.map { |m| "`#{m}`" }.to_sentence
|
||||||
maximum_methods = ::Utils.to_sentence(allowed_methods.last.map { |m| "`#{m}`" })
|
maximum_methods = allowed_methods.last.map { |m| "`#{m}`" }.to_sentence
|
||||||
|
|
||||||
on_system_bodies.each do |on_system_block, on_system_body|
|
on_system_bodies.each do |on_system_block, on_system_body|
|
||||||
method_name = on_system_block.method_name
|
method_name = on_system_block.method_name
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user