diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index f81026ffa9..a65cee3949 100644 --- a/Library/Homebrew/cask/cmd.rb +++ b/Library/Homebrew/cask/cmd.rb @@ -228,7 +228,7 @@ module Cask end def run(*) - exec @path, *ARGV[1..-1] + exec @path, *ARGV[1..] end end diff --git a/Library/Homebrew/cask/cmd/abstract_command.rb b/Library/Homebrew/cask/cmd/abstract_command.rb index c6b988eb4d..1646ddb943 100644 --- a/Library/Homebrew/cask/cmd/abstract_command.rb +++ b/Library/Homebrew/cask/cmd/abstract_command.rb @@ -37,6 +37,7 @@ module Cask end attr_accessor :args + private :args= def initialize(*args) diff --git a/Library/Homebrew/cask/cmd/internal_stanza.rb b/Library/Homebrew/cask/cmd/internal_stanza.rb index 578e5f06f4..20235e13af 100644 --- a/Library/Homebrew/cask/cmd/internal_stanza.rb +++ b/Library/Homebrew/cask/cmd/internal_stanza.rb @@ -33,9 +33,11 @@ module Cask option "--inspect", :inspect, false attr_accessor :format + private :format, :format= attr_accessor :stanza + private :stanza, :stanza= def initialize(*) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index ed3c11c4bb..3d8ca97571 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -23,6 +23,7 @@ class AbstractDownloadStrategy attr_reader :cache, :cached_location, :url attr_reader :meta, :name, :version, :shutup + private :meta, :name, :version, :shutup def initialize(url, name, version, **meta) diff --git a/Library/Homebrew/extend/os/linux/hardware/cpu.rb b/Library/Homebrew/extend/os/linux/hardware/cpu.rb index 67dd402a1c..4f37ac614b 100644 --- a/Library/Homebrew/extend/os/linux/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/linux/hardware/cpu.rb @@ -80,7 +80,7 @@ module Hardware # Compatibility with Mac method, which returns lowercase symbols # instead of strings def features - @features ||= flags[1..-1].map(&:intern) + @features ||= flags[1..].map(&:intern) end %w[aes altivec avx avx2 lm ssse3 sse4_2].each do |flag| diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index f431b19dfa..faa86fceec 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -126,6 +126,7 @@ class Formula # The currently active {SoftwareSpec}. # @see #determine_active_spec attr_reader :active_spec + protected :active_spec # A symbol to indicate currently active {SoftwareSpec}. @@ -176,6 +177,7 @@ class Formula # Defaults to true. # @return [Boolean] attr_accessor :follow_installed_alias + alias follow_installed_alias? follow_installed_alias # @private diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 9dbb75674e..3e281a7588 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -25,6 +25,7 @@ class FormulaInstaller def self.mode_attr_accessor(*names) attr_accessor(*names) + private(*names) names.each do |name| predicate = "#{name}?" @@ -38,6 +39,7 @@ class FormulaInstaller attr_reader :formula attr_accessor :options, :build_bottle attr_accessor :installed_as_dependency, :installed_on_request, :link_keg + mode_attr_accessor :show_summary_heading, :show_header mode_attr_accessor :build_from_source, :force_bottle, :include_test mode_attr_accessor :ignore_deps, :only_deps, :interactive, :git diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index d40cf4457b..16818f0ce2 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -184,6 +184,7 @@ class Keg end attr_reader :path, :name, :linked_keg_record, :opt_record + protected :path extend Forwardable diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb index ebd2179a24..f593ca5753 100644 --- a/Library/Homebrew/requirement.rb +++ b/Library/Homebrew/requirement.rb @@ -151,6 +151,7 @@ class Requirement include BuildEnvironment::DSL attr_reader :env_proc, :build + attr_rw :fatal, :cask, :download def satisfy(options = nil, &block) diff --git a/Library/Homebrew/rubocops/cask/homepage_matches_url.rb b/Library/Homebrew/rubocops/cask/homepage_matches_url.rb index 34c5261698..b260d5c730 100644 --- a/Library/Homebrew/rubocops/cask/homepage_matches_url.rb +++ b/Library/Homebrew/rubocops/cask/homepage_matches_url.rb @@ -40,6 +40,7 @@ module RuboCop private attr_reader :cask_block + def_delegators :cask_block, :cask_node, :toplevel_stanzas, :sorted_toplevel_stanzas @@ -141,10 +142,10 @@ module RuboCop end home = homepage.downcase if (split_host = host.split(".")).length >= 3 - host = split_host[-2..-1].join(".") + host = split_host[-2..].join(".") end if (split_home = homepage.split(".")).length >= 3 - home = split_home[-2..-1].join(".") + home = split_home[-2..].join(".") end host == home end diff --git a/Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb b/Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb index 24d65737c3..f76d258faa 100644 --- a/Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb +++ b/Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb @@ -19,6 +19,7 @@ module RuboCop private attr_reader :cask_block + def_delegators :cask_block, :toplevel_stanzas end diff --git a/Library/Homebrew/rubocops/cask/stanza_grouping.rb b/Library/Homebrew/rubocops/cask/stanza_grouping.rb index 631d2c7e2a..aec43875c7 100644 --- a/Library/Homebrew/rubocops/cask/stanza_grouping.rb +++ b/Library/Homebrew/rubocops/cask/stanza_grouping.rb @@ -39,6 +39,7 @@ module RuboCop private attr_reader :cask_block, :line_ops + def_delegators :cask_block, :cask_node, :toplevel_stanzas def add_offenses diff --git a/Library/Homebrew/rubocops/cask/stanza_order.rb b/Library/Homebrew/rubocops/cask/stanza_order.rb index bb8c153ba7..2a81bdb113 100644 --- a/Library/Homebrew/rubocops/cask/stanza_order.rb +++ b/Library/Homebrew/rubocops/cask/stanza_order.rb @@ -31,6 +31,7 @@ module RuboCop private attr_reader :cask_block + def_delegators :cask_block, :cask_node, :toplevel_stanzas, :sorted_toplevel_stanzas diff --git a/Library/Homebrew/rubocops/extend/formula.rb b/Library/Homebrew/rubocops/extend/formula.rb index 74eef626ee..81281cd63a 100644 --- a/Library/Homebrew/rubocops/extend/formula.rb +++ b/Library/Homebrew/rubocops/extend/formula.rb @@ -17,6 +17,7 @@ module RuboCop include RangeHelp attr_accessor :file_path + @registry = Cop.registry # This method is called by RuboCop and is the main entry point