Skip to content

Commit

Permalink
Merge pull request #16358 from Homebrew/dependabot/bundler/Library/Ho…
Browse files Browse the repository at this point in the history
…mebrew/rubocop-performance-1.20.0

build(deps-dev): bump rubocop-performance from 1.19.1 to 1.20.0 in /Library/Homebrew
  • Loading branch information
MikeMcQuaid authored Dec 19, 2023
2 parents db01274 + 9dee80c commit 38c5e52
Show file tree
Hide file tree
Showing 16 changed files with 127 additions and 98 deletions.
6 changes: 3 additions & 3 deletions Library/Homebrew/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ GEM
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-performance (1.20.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails (2.23.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/brew.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
exit Homebrew.failed? ? 1 : 0
elsif Commands.external_cmd_path(cmd)
%w[CACHE LIBRARY_PATH].each do |env|
ENV["HOMEBREW_#{env}"] = Object.const_get("HOMEBREW_#{env}").to_s
ENV["HOMEBREW_#{env}"] = Object.const_get(:"HOMEBREW_#{env}").to_s
end
exec "brew-#{cmd}", *ARGV
else
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/artifact/abstract_uninstall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def dispatch_uninstall_directive(directive_sym, **options)

args = directives[directive_sym]

send("uninstall_#{directive_sym}", *(args.is_a?(Hash) ? [args] : args), **options)
send(:"uninstall_#{directive_sym}", *(args.is_a?(Hash) ? [args] : args), **options)
end

def stanza
Expand Down
10 changes: 5 additions & 5 deletions Library/Homebrew/cask/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,20 @@ def desc(description = nil)
end

def set_unique_stanza(stanza, should_return)
return instance_variable_get("@#{stanza}") if should_return
return instance_variable_get(:"@#{stanza}") if should_return

unless @cask.allow_reassignment
if instance_variable_defined?("@#{stanza}") && !@called_in_on_system_block
if instance_variable_defined?(:"@#{stanza}") && !@called_in_on_system_block
raise CaskInvalidError.new(cask, "'#{stanza}' stanza may only appear once.")
end

if instance_variable_defined?("@#{stanza}_set_in_block") && @called_in_on_system_block
if instance_variable_defined?(:"@#{stanza}_set_in_block") && @called_in_on_system_block
raise CaskInvalidError.new(cask, "'#{stanza}' stanza may only be overridden once.")
end
end

instance_variable_set("@#{stanza}_set_in_block", true) if @called_in_on_system_block
instance_variable_set("@#{stanza}", yield)
instance_variable_set(:"@#{stanza}_set_in_block", true) if @called_in_on_system_block
instance_variable_set(:"@#{stanza}", yield)
rescue CaskInvalidError
raise
rescue => e
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/compilers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def compiler_version(name)
when "gcc", GNU_GCC_REGEXP
versions.gcc_version(name.to_s)
else
versions.send("#{name}_build_version")
versions.send(:"#{name}_build_version")
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions Library/Homebrew/extend/on_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def self.arch_condition_met?(arch)

sig { params(os_name: Symbol, or_condition: T.nilable(Symbol)).returns(T::Boolean) }
def self.os_condition_met?(os_name, or_condition = nil)
return Homebrew::SimulateSystem.send("simulating_or_running_on_#{os_name}?") if BASE_OS_OPTIONS.include?(os_name)
return Homebrew::SimulateSystem.send(:"simulating_or_running_on_#{os_name}?") if BASE_OS_OPTIONS.include?(os_name)

raise ArgumentError, "Invalid OS condition: #{os_name.inspect}" unless MacOSVersion::SYMBOLS.key?(os_name)

Expand Down Expand Up @@ -51,7 +51,7 @@ def self.condition_from_method_name(method_name)
sig { params(base: Class).void }
def self.setup_arch_methods(base)
ARCH_OPTIONS.each do |arch|
base.define_method("on_#{arch}") do |&block|
base.define_method(:"on_#{arch}") do |&block|
@on_system_blocks_exist = true

return unless OnSystem.arch_condition_met? OnSystem.condition_from_method_name(T.must(__method__))
Expand All @@ -78,7 +78,7 @@ def self.setup_arch_methods(base)
sig { params(base: Class).void }
def self.setup_base_os_methods(base)
BASE_OS_OPTIONS.each do |base_os|
base.define_method("on_#{base_os}") do |&block|
base.define_method(:"on_#{base_os}") do |&block|
@on_system_blocks_exist = true

return unless OnSystem.os_condition_met? OnSystem.condition_from_method_name(T.must(__method__))
Expand Down Expand Up @@ -124,7 +124,7 @@ def self.setup_base_os_methods(base)
sig { params(base: Class).void }
def self.setup_macos_methods(base)
MacOSVersion::SYMBOLS.each_key do |os_name|
base.define_method("on_#{os_name}") do |or_condition = nil, &block|
base.define_method(:"on_#{os_name}") do |or_condition = nil, &block|
@on_system_blocks_exist = true

os_condition = OnSystem.condition_from_method_name T.must(__method__)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/extend/os/linux/hardware/cpu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def features
end

%w[aes altivec avx avx2 lm ssse3 sse4_2].each do |flag|
define_method("#{flag}?") do
define_method(:"#{flag}?") do
T.bind(self, T.class_of(Hardware::CPU))
flags.include? flag
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def spec_eval(name)

spec.owner = self
add_global_deps_to_spec(spec)
instance_variable_set("@#{name}", spec)
instance_variable_set(:"@#{name}", spec)
end

sig { params(spec: SoftwareSpec).void }
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def initialize(language, script, region)
}.each do |key, value|
next if value.nil?

regex = self.class.const_get("#{key.upcase}_REGEX")
regex = self.class.const_get(:"#{key.upcase}_REGEX")
raise ParserError, "'#{value}' does not match #{regex}" unless value&.match?(regex)

instance_variable_set(:"@#{key}", value)
Expand Down
Loading

0 comments on commit 38c5e52

Please sign in to comment.