Skip to content

Commit

Permalink
formula_creator: Remove tap accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
abitrolly committed Nov 29, 2023
1 parent 2d9db76 commit a7756bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Library/Homebrew/dev-cmd/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ def create_formula(args:)
print "Formula name [#{stem}]: "
fc.name = __gets || stem

Check warning on line 177 in Library/Homebrew/dev-cmd/create.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/create.rb#L176-L177

Added lines #L176 - L177 were not covered by tests
end
raise TapUnavailableError, fc.tap.name unless fc.tap.installed?

fc.url = args.named.first

fc.verify

# Check for disallowed formula, or names that shadow aliases,
# unless --force is specified.
unless args.force?
Expand Down
6 changes: 5 additions & 1 deletion Library/Homebrew/formula_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module Homebrew
#
# @api private
class FormulaCreator
attr_reader :tap
attr_accessor :name

sig {
Expand All @@ -26,6 +25,11 @@ def initialize(name, version, tap:, mode:, license:, fetch: true, head: false)
@head = head
end

sig { void }
def verify
raise TapUnavailableError, @tap.name unless @tap.installed?
end

def url=(url)
@url = url
path = Pathname.new(url)
Expand Down

0 comments on commit a7756bd

Please sign in to comment.