Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Gems. #9152

Merged
merged 3 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions Library/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ Performance/CaseWhenSplat:
Performance/Caller:
Enabled: false

# Enable when https://github.com/Homebrew/homebrew-core/pull/64983 is merged.
Performance/ConstantRegexp:
Enabled: false

# Makes code less readable for minor performance increases.
Performance/MethodObjectAsBlock:
Enabled: false

# Don't allow cops to be disabled in casks and formulae.
Style/DisableCopsWithinSourceCodeDirective:
Enabled: true
Expand Down
20 changes: 10 additions & 10 deletions Library/Homebrew/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ GEM
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.0512)
mime-types-data (3.2020.1104)
mini_portile2 (2.4.0)
minitest (5.14.2)
mustache (1.1.1)
Expand Down Expand Up @@ -98,7 +98,7 @@ GEM
rspec-support (3.10.0)
rspec-wait (0.0.9)
rspec (>= 3, < 4)
rubocop (1.3.0)
rubocop (1.3.1)
parallel (~> 1.10)
parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
Expand All @@ -109,8 +109,8 @@ GEM
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.1.1)
parser (>= 2.7.1.5)
rubocop-performance (1.8.1)
rubocop (>= 0.87.0)
rubocop-performance (1.9.0)
rubocop (>= 0.90.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rspec (2.0.0)
rubocop (~> 1.0)
Expand All @@ -123,11 +123,11 @@ GEM
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov-html (0.12.3)
sorbet (0.5.6060)
sorbet-static (= 0.5.6060)
sorbet-runtime (0.5.6060)
sorbet (0.5.6076)
sorbet-static (= 0.5.6076)
sorbet-runtime (0.5.6076)
sorbet-runtime-stub (0.2.0)
sorbet-static (0.5.6060-universal-darwin-14)
sorbet-static (0.5.6076-universal-darwin-14)
spoom (1.0.4)
colorize
sorbet (~> 0.5.5)
Expand All @@ -142,14 +142,14 @@ GEM
thor (>= 0.19.2)
thor (1.0.1)
thread_safe (0.3.6)
tzinfo (1.2.7)
tzinfo (1.2.8)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
webrobots (0.1.2)
zeitwerk (2.4.0)
zeitwerk (2.4.1)

PLATFORMS
ruby
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/cask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Cask
attr_reader :token, :sourcefile_path, :config, :default_config

def self.each(&block)
return to_enum unless block_given?
return to_enum unless block

Tap.flat_map(&:cask_files).each do |f|
block.call CaskLoader::FromTapPathLoader.new(f).load(config: nil)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/cmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def self.description

def self.parser(&block)
Homebrew::CLI::Parser.new do
if block_given?
if block
instance_eval(&block)
else
usage_banner <<~EOS
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/cmd/abstract_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def self.parser(&block)
Cmd.parser do
usage_banner banner

instance_eval(&block) if block_given?
instance_eval(&block) if block

OPTIONS.each do |option|
send(*option)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/cmd/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def self.parser(&block)
send(*option)
end

instance_eval(&block) if block_given?
instance_eval(&block) if block
end
end

Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cask/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def homepage(homepage = nil)
def language(*args, default: false, &block)
if args.empty?
language_eval
elsif block_given?
elsif block
@language_blocks ||= {}
@language_blocks[args] = block

Expand Down Expand Up @@ -248,7 +248,7 @@ def staged_path

def caveats(*strings, &block)
@caveats ||= DSL::Caveats.new(cask)
if block_given?
if block
@caveats.eval_caveats(&block)
elsif strings.any?
strings.each do |string|
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cli/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def initialize(&block)
switch short, long, description: desc, env: option_to_name(long), method: :on_tail
end

instance_eval(&block) if block_given?
instance_eval(&block) if block
end

def switch(*names, description: nil, env: nil, required_for: nil, depends_on: nil, method: :on)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/compilers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def self.create(spec, &block)
def initialize(name, version, &block)
@name = name
@version = Version.parse(version.to_s)
instance_eval(&block) if block_given?
instance_eval(&block) if block
end

def fails_with?(compiler)
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ def expand(dependent, deps = dependent.deps, &block)
@expand_stack.pop
end

def action(dependent, dep, &_block)
def action(dependent, dep, &block)
catch(:action) do
if block_given?
if block
yield dependent, dep
elsif dep.optional? || dep.recommended?
prune unless dependent.build.with?(dep)
Expand Down
8 changes: 4 additions & 4 deletions Library/Homebrew/extend/os/linux/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
class Formula
undef on_linux

def on_linux(&_block)
raise "No block content defined for on_linux block" unless block_given?
def on_linux(&block)
raise "No block content defined for on_linux block" unless block

yield
end
Expand All @@ -19,8 +19,8 @@ def shared_library(name, version = nil)
class << self
undef on_linux

def on_linux(&_block)
raise "No block content defined for on_linux block" unless block_given?
def on_linux(&block)
raise "No block content defined for on_linux block" unless block

yield
end
Expand Down
8 changes: 4 additions & 4 deletions Library/Homebrew/extend/os/mac/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
class Formula
undef on_macos

def on_macos(&_block)
raise "No block content defined for on_macos block" unless block_given?
def on_macos(&block)
raise "No block content defined for on_macos block" unless block

yield
end

class << self
undef on_macos

def on_macos(&_block)
raise "No block content defined for on_macos block" unless block_given?
def on_macos(&block)
raise "No block content defined for on_macos block" unless block

yield
end
Expand Down
26 changes: 13 additions & 13 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def validate_attributes!
# and is specified to this instance.
def installed_alias_path
path = build.source["path"] if build.is_a?(Tab)
return unless path&.match?(%r{#{HOMEBREW_TAP_DIR_REGEX}/Aliases})
return unless path&.match?(%r{#{HOMEBREW_TAP_DIR_REGEX}/Aliases}o)
return unless File.symlink?(path)

path
Expand Down Expand Up @@ -1384,16 +1384,16 @@ def inspect
# <pre>on_macos do
# # Do something Mac-specific
# end</pre>
def on_macos(&_block)
raise "No block content defined for on_macos block" unless block_given?
def on_macos(&block)
raise "No block content defined for on_macos block" unless block
end

# Block only executed on Linux. No-op on macOS.
# <pre>on_linux do
# # Do something Linux-specific
# end</pre>
def on_linux(&_block)
raise "No block content defined for on_linux block" unless block_given?
def on_linux(&block)
raise "No block content defined for on_linux block" unless block
end

# Standard parameters for cargo builds.
Expand Down Expand Up @@ -2118,7 +2118,7 @@ def mktemp(prefix = name, opts = {}, &block)
# a block.
def mkdir(name, &block)
result = FileUtils.mkdir_p(name)
return result unless block_given?
return result unless block

FileUtils.chdir(name, &block)
end
Expand Down Expand Up @@ -2458,7 +2458,7 @@ def build_flags
# end</pre>
def stable(&block)
@stable ||= SoftwareSpec.new(flags: build_flags)
return @stable unless block_given?
return @stable unless block

@stable.instance_eval(&block)
end
Expand All @@ -2482,7 +2482,7 @@ def devel
# <pre>head "https://hg.is.awesome.but.git.has.won.example.com/", using: :hg</pre>
def head(val = nil, specs = {}, &block)
@head ||= HeadSoftwareSpec.new(flags: build_flags)
if block_given?
if block
@head.instance_eval(&block)
elsif val
@head.url(val, specs)
Expand Down Expand Up @@ -2553,16 +2553,16 @@ def uses_from_macos(dep, bounds = {})
# <pre>on_macos do
# depends_on "mac_only_dep"
# end</pre>
def on_macos(&_block)
raise "No block content defined for on_macos block" unless block_given?
def on_macos(&block)
raise "No block content defined for on_macos block" unless block
end

# Block only executed on Linux. No-op on macOS.
# <pre>on_linux do
# depends_on "linux_only_dep"
# end</pre>
def on_linux(&_block)
raise "No block content defined for on_linux block" unless block_given?
def on_linux(&block)
raise "No block content defined for on_linux block" unless block
end

# @!attribute [w] option
Expand Down Expand Up @@ -2757,7 +2757,7 @@ def test(&block)
# end</pre>
def livecheck(&block)
@livecheck ||= Livecheck.new(self)
return @livecheck unless block_given?
return @livecheck unless block

@livecheckable = true
@livecheck.instance_eval(&block)
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/language/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def create
next unless f.symlink?
next unless (rp = f.realpath.to_s).start_with? HOMEBREW_CELLAR

version = rp.match %r{^#{HOMEBREW_CELLAR}/python@(.*?)/}
version = rp.match %r{^#{HOMEBREW_CELLAR}/python@(.*?)/}o
version = "@#{version.captures.first}" unless version.nil?

new_target = rp.sub %r{#{HOMEBREW_CELLAR}/python#{version}/[^/]+}, Formula["python#{version}"].opt_prefix
Expand All @@ -281,7 +281,7 @@ def create
Pathname.glob(@venv_root/"lib/python*/orig-prefix.txt").each do |prefix_file|
prefix_path = prefix_file.read

version = prefix_path.match %r{^#{HOMEBREW_CELLAR}/python@(.*?)/}
version = prefix_path.match %r{^#{HOMEBREW_CELLAR}/python@(.*?)/}o
version = "@#{version.captures.first}" unless version.nil?

prefix_path.sub! %r{^#{HOMEBREW_CELLAR}/python#{version}/[^/]+}, Formula["python#{version}"].opt_prefix
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/linkage_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def broken_dylibs_with_expectations
private

def dylib_to_dep(dylib)
dylib =~ %r{#{Regexp.escape(HOMEBREW_PREFIX)}/(opt|Cellar)/([\w+-.@]+)/}
dylib =~ %r{#{Regexp.escape(HOMEBREW_PREFIX)}/(opt|Cellar)/([\w+-.@]+)/}o
Regexp.last_match(2)
end

Expand Down
10 changes: 5 additions & 5 deletions Library/Homebrew/requirement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def satisfied_result_parent
return unless @satisfied_result.is_a?(Pathname)

parent = @satisfied_result.resolved_path.parent
if parent.to_s =~ %r{^#{Regexp.escape(HOMEBREW_CELLAR)}/([\w+-.@]+)/[^/]+/(s?bin)/?$}
if parent.to_s =~ %r{^#{Regexp.escape(HOMEBREW_CELLAR)}/([\w+-.@]+)/[^/]+/(s?bin)/?$}o
parent = HOMEBREW_PREFIX/"opt/#{Regexp.last_match(1)}/#{Regexp.last_match(2)}"
end
parent
Expand Down Expand Up @@ -168,14 +168,14 @@ class << self
attr_rw :fatal, :cask, :download

def satisfy(options = nil, &block)
return @satisfied if options.nil? && !block_given?
return @satisfied if options.nil? && !block

options = {} if options.nil?
@satisfied = Satisfier.new(options, &block)
end

def env(*settings, &block)
if block_given?
if block
@env_proc = block
else
super
Expand Down Expand Up @@ -236,9 +236,9 @@ def expand(dependent, &block)
reqs
end

def prune?(dependent, req, &_block)
def prune?(dependent, req, &block)
catch(:prune) do
if block_given?
if block
yield dependent, req
elsif req.optional? || req.recommended?
prune unless dependent.build.with?(req)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def initialize(name = nil, &block)
@checksum = nil
@using = nil
@patches = []
instance_eval(&block) if block_given?
instance_eval(&block) if block
end

def owner=(owner)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/software_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def resource_defined?(name)
end

def resource(name, klass = Resource, &block)
if block_given?
if block
raise DuplicateResourceError, name if resource_defined?(name)

res = klass.new(name, &block)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def ==(other)
def self.each(&block)
return unless TAP_DIRECTORY.directory?

return to_enum unless block_given?
return to_enum unless block

TAP_DIRECTORY.subdirs.each do |user|
user.subdirs.each do |repo|
Expand Down