Skip to content

Commit

Permalink
Restore constants needed by homebrew-test-bot
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Oct 8, 2024
1 parent 4111b0a commit 14a6054
Show file tree
Hide file tree
Showing 12 changed files with 785 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/cask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def refresh
@dsl.language_eval
end

DSL::DSL_METHODS.each do |method_name|
::Cask::DSL::DSL_METHODS.each do |method_name|
define_method(method_name) { |&block| @dsl.send(method_name, &block) }
end

Expand Down
6 changes: 0 additions & 6 deletions Library/Homebrew/extend/on_system.rbi

This file was deleted.

8 changes: 8 additions & 0 deletions Library/Homebrew/extend/os/mac/keg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

require "system_command"

class Keg
GENERIC_MUST_BE_WRITABLE_DIRECTORIES = (remove_const :MUST_BE_WRITABLE_DIRECTORIES).freeze
MUST_BE_WRITABLE_DIRECTORIES = (
GENERIC_MUST_BE_WRITABLE_DIRECTORIES +
[HOMEBREW_PREFIX/"Frameworks"]
).sort.uniq.freeze
end

module OS
module Mac
module Keg
Expand Down
27 changes: 26 additions & 1 deletion Library/Homebrew/keg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,32 @@ def to_s
# Locale-specific directories have the form `language[_territory][.codeset][@modifier]`
LOCALEDIR_RX = %r{(locale|man)/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?}
INFOFILE_RX = %r{info/([^.].*?\.info(\.gz)?|dir)$}

KEG_LINK_DIRECTORIES = %w[
bin etc include lib sbin share var
].freeze
MUST_EXIST_SUBDIRECTORIES = (
KEG_LINK_DIRECTORIES - %w[var] + %w[
opt
var/homebrew/linked
]
).map { |dir| HOMEBREW_PREFIX/dir }.sort.uniq.freeze
MUST_BE_WRITABLE_DIRECTORIES = (
%w[
etc/bash_completion.d lib/pkgconfig
share/aclocal share/doc share/info share/locale share/man
share/man/man1 share/man/man2 share/man/man3 share/man/man4
share/man/man5 share/man/man6 share/man/man7 share/man/man8
share/zsh share/zsh/site-functions
var/log
].map { |dir| HOMEBREW_PREFIX/dir } + MUST_EXIST_SUBDIRECTORIES + [
HOMEBREW_CACHE,
HOMEBREW_CELLAR,
HOMEBREW_LOCKS,
HOMEBREW_LOGS,
HOMEBREW_REPOSITORY,
Language::Python.homebrew_site_packages,
]
).sort.uniq.freeze
# These paths relative to the keg's share directory should always be real
# directories in the prefix, never symlinks.
SHARE_PATHS = %w[
Expand Down
3 changes: 2 additions & 1 deletion Library/Homebrew/livecheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# frozen_string_literal: true

require "livecheck/constants"
require "cask/cask"

module Cask; class Cask; end; end

# The {Livecheck} class implements the DSL methods used in a formula's, cask's
# or resource's `livecheck` block and stores related instance variables. Most
Expand Down
107 changes: 107 additions & 0 deletions Library/Homebrew/sorbet/rbi/dsl/cask/dsl.rbi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 113 additions & 0 deletions Library/Homebrew/sorbet/rbi/dsl/formula.rbi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 14a6054

Please sign in to comment.