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

ARGV: Deprecate ARGV.formulae, replace with Homebrew.args.formulae #7478

Merged
merged 1 commit into from May 2, 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
11 changes: 0 additions & 11 deletions Library/Homebrew/extend/ARGV.rb
Expand Up @@ -5,17 +5,6 @@ def flags_only
select { |arg| arg.start_with?("--") }
end

def formulae
require "formula"
(downcased_unique_named - casks).map do |name|
if name.include?("/") || File.exist?(name)
Formulary.factory(name, spec)
else
Formulary.find_with_priority(name, spec)
end
end.uniq(&:name)
end

def casks
# TODO: use @instance variable to ||= cache when moving to CLI::Parser
downcased_unique_named.grep HOMEBREW_CASK_TAP_CASK_REGEX
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/formula_installer.rb
Expand Up @@ -82,7 +82,7 @@ def self.prevent_build_flags
build_flags = Homebrew.args.collect_build_args
return if build_flags.empty?

all_bottled = ARGV.formulae.all?(&:bottled?)
all_bottled = Homebrew.args.formulae.all?(&:bottled?)
raise BuildFlagsError.new(build_flags, bottled: all_bottled)
end

Expand Down
14 changes: 0 additions & 14 deletions Library/Homebrew/test/ARGV_spec.rb
Expand Up @@ -7,20 +7,6 @@

let(:argv) { ["mxcl"] }

describe "#formulae" do
it "raises an error when a Formula is unavailable" do
expect { subject.formulae }.to raise_error FormulaUnavailableError
end

context "when there are no Formulae" do
let(:argv) { [] }

it "returns an empty array" do
expect(subject.formulae).to be_empty
end
end
end

describe "#casks" do
it "returns an empty array if there is no match" do
expect(subject.casks).to eq []
Expand Down