source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/utils/uid.rb | Ruby | bsd-2-clause | 47,751 | main | 287 | # typed: strict
# frozen_string_literal: true
module Utils
module UID
sig { returns(T.nilable(String)) }
def self.uid_home
require "etc"
Etc.getpwuid(Process.uid)&.dir
rescue ArgumentError
# Cover for misconfigured NSS setups
nil
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/utils/link.rb | Ruby | bsd-2-clause | 47,751 | main | 2,989 | # typed: strict
# frozen_string_literal: true
require "utils/output"
module Utils
# Helper functions for creating symlinks.
module Link
extend Utils::Output::Mixin
sig { params(src_dir: Pathname, dst_dir: Pathname, command: String, link_dir: T::Boolean).void }
def self.link_src_dst_dirs(src_dir, dst_... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/utils/shebang.rb | Ruby | bsd-2-clause | 47,751 | main | 1,370 | # typed: strict
# frozen_string_literal: true
module Utils
# Helper functions for manipulating shebang lines.
module Shebang
extend T::Helpers
requires_ancestor { Kernel }
module_function
# Specification on how to rewrite a given shebang.
class RewriteInfo
sig { returns(Regexp) }
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/utils/repology.rb | Ruby | bsd-2-clause | 47,751 | main | 2,353 | # typed: strict
# frozen_string_literal: true
require "utils/curl"
require "utils/output"
# Repology API client.
module Repology
extend Utils::Output::Mixin
HOMEBREW_CORE = "homebrew"
HOMEBREW_CASK = "homebrew_casks"
MAX_PAGINATION = 15
private_constant :MAX_PAGINATION
sig { params(last_package_in_respo... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/utils/fork.rb | Ruby | bsd-2-clause | 47,751 | main | 4,147 | # typed: strict
# frozen_string_literal: true
require "fcntl"
require "utils/socket"
module Utils
sig { params(child_error: T::Hash[String, T.untyped]).returns(Exception) }
def self.rewrite_child_error(child_error)
inner_class = Object.const_get(child_error["json_class"])
error = if child_error["cmd"] && ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/utils/shell_completion.rb | Ruby | bsd-2-clause | 47,751 | main | 2,210 | # typed: strict
# frozen_string_literal: true
module Utils
# Shared logic for generating shell completion scripts.
# Used by both {Formula#generate_completions_from_executable} and
# {Cask::Artifact::GeneratedCompletion}.
module ShellCompletion
sig { params(format: T.nilable(T.any(Symbol, String))).returns... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/utils/ast.rb | Ruby | bsd-2-clause | 47,751 | main | 8,715 | # typed: strict
# frozen_string_literal: true
require "ast_constants"
require "rubocop-ast"
module Utils
# Helper functions for editing Ruby files.
module AST
Node = RuboCop::AST::Node
SendNode = RuboCop::AST::SendNode
BlockNode = RuboCop::AST::BlockNode
ProcessedSource = RuboCop::AST::ProcessedSo... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/utils/rubocop.rb | Ruby | bsd-2-clause | 47,751 | main | 217 | #!/usr/bin/env ruby
# typed: strict
# frozen_string_literal: true
require_relative "../standalone"
require_relative "../warnings"
Warnings.ignore :parser_syntax do
require "rubocop"
end
exit RuboCop::CLI.new.run |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/utils/ruby_check_version_script.rb | Ruby | bsd-2-clause | 47,751 | main | 1,082 | #!/usr/bin/env ruby
# typed: strict
# frozen_string_literal: true
HOMEBREW_REQUIRED_RUBY_VERSION = ARGV.first.freeze
raise "No Ruby version passed!" if HOMEBREW_REQUIRED_RUBY_VERSION.to_s.empty?
require "rubygems"
ruby_version = Gem::Version.new(RUBY_VERSION)
homebrew_required_ruby_version = Gem::Version.new(HOMEBRE... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/utils/github/api.rb | Ruby | bsd-2-clause | 47,751 | main | 17,093 | # typed: strict
# frozen_string_literal: true
require "system_command"
require "utils/output"
module GitHub
sig { params(scopes: T::Array[String]).returns(String) }
def self.pat_blurb(scopes = ALL_SCOPES)
require "utils/formatter"
require "utils/shell"
<<~EOS
Create a GitHub personal access toke... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/utils/github/actions.rb | Ruby | bsd-2-clause | 47,751 | main | 3,814 | # typed: strict
# frozen_string_literal: true
module GitHub
# Helper functions for interacting with GitHub Actions.
#
# @api internal
module Actions
sig { params(string: String).returns(String) }
def self.escape(string)
# See https://github.community/t/set-output-truncates-multiline-strings/16852... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/utils/github/artifacts.rb | Ruby | bsd-2-clause | 47,751 | main | 2,117 | # typed: strict
# frozen_string_literal: true
require "download_strategy"
require "utils/github"
module GitHub
# Download an artifact from GitHub Actions and unpack it into the current working directory.
#
# @param url [String] URL to download from
# @param artifact_id [String] a value that uniquely identifie... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/yard/docstring_parser.rb | Ruby | bsd-2-clause | 47,751 | main | 4,127 | # typed: strict
# frozen_string_literal: true
require "sorbet-runtime"
require_relative "../extend/module"
# from https://github.com/lsegal/yard/issues/484#issuecomment-442586899
module Homebrew
module YARD
class DocstringParser < ::YARD::DocstringParser
# Every `Object` has these methods.
unless co... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/yard/templates/default/docstring/html/setup.rb | Ruby | bsd-2-clause | 47,751 | main | 797 | # typed: strict
# frozen_string_literal: true
# This follows the docs at https://github.com/lsegal/yard/blob/main/docs/Templates.md#setuprb
# rubocop:disable Style/TopLevelMethodDefinition
sig { void }
def init
# `sorbet` is available transitively through the `yard-sorbet` plugin, but we're
# outside of the standa... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/api/cask.rb | Ruby | bsd-2-clause | 47,751 | main | 5,335 | # typed: strict
# frozen_string_literal: true
require "cachable"
require "api"
require "api/source_download"
require "download_queue"
require "api/cask/cask_struct_generator"
module Homebrew
module API
# Helper functions for using the cask JSON API.
module Cask
extend T::Generic
extend Cachable
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/api/cask_struct.rb | Ruby | bsd-2-clause | 47,751 | main | 8,233 | # typed: strict
# frozen_string_literal: true
module Homebrew
module API
class CaskStruct < T::Struct
sig { params(cask_hash: T::Hash[String, T.untyped], ignore_types: T::Boolean).returns(CaskStruct) }
def self.from_hash(cask_hash, ignore_types: false)
return super(cask_hash) if ignore_types
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/api/formula.rb | Ruby | bsd-2-clause | 47,751 | main | 6,304 | # typed: strict
# frozen_string_literal: true
require "cachable"
require "api"
require "api/source_download"
require "download_queue"
require "api/formula/formula_struct_generator"
module Homebrew
module API
# Helper functions for using the formula JSON API.
module Formula
extend T::Generic
exte... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/api/source_download.rb | Ruby | bsd-2-clause | 47,751 | main | 1,200 | # typed: strict
# frozen_string_literal: true
require "downloadable"
module Homebrew
module API
class SourceDownloadStrategy < CurlDownloadStrategy
sig { override.returns(Pathname) }
def symlink_location
cache/name
end
end
class SourceDownload
include Downloadable
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/api/json_download.rb | Ruby | bsd-2-clause | 47,751 | main | 1,649 | # typed: strict
# frozen_string_literal: true
require "downloadable"
module Homebrew
module API
class JSONDownloadStrategy < AbstractDownloadStrategy
sig { params(url: String, name: String, version: T.nilable(T.any(String, Version)), meta: T.untyped).void }
def initialize(url, name, version, **meta)... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/api/formula_struct.rb | Ruby | bsd-2-clause | 47,751 | main | 9,499 | # typed: strict
# frozen_string_literal: true
require "service"
require "utils/spdx"
module Homebrew
module API
class FormulaStruct < T::Struct
sig { params(formula_hash: T::Hash[String, T.untyped]).returns(FormulaStruct) }
def self.from_hash(formula_hash)
formula_hash = ::Formula.deep_remov... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/api/internal.rb | Ruby | bsd-2-clause | 47,751 | main | 6,579 | # typed: strict
# frozen_string_literal: true
require "cachable"
require "api"
require "api/source_download"
require "download_queue"
module Homebrew
module API
# Helper functions for using the JSON internal API.
module Internal
extend T::Generic
extend Cachable
# Sorbet type members are ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/api/analytics.rb | Ruby | bsd-2-clause | 47,751 | main | 533 | # typed: strict
# frozen_string_literal: true
module Homebrew
module API
# Helper functions for using the analytics JSON API.
module Analytics
class << self
sig { returns(String) }
def analytics_api_path
"analytics"
end
sig { params(category: String, days: T.a... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/api/formula/formula_struct_generator.rb | Ruby | bsd-2-clause | 47,751 | main | 12,554 | # typed: strict
# frozen_string_literal: true
require "deprecate_disable"
module Homebrew
module API
module Formula
# Methods for generating FormulaStruct instances from API data.
module FormulaStructGenerator
module_function
# `:codesign` and custom requirement classes are not supp... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/api/cask/cask_struct_generator.rb | Ruby | bsd-2-clause | 47,751 | main | 5,579 | # typed: strict
# frozen_string_literal: true
module Homebrew
module API
module Cask
# Methods for generating CaskStruct instances from API data.
module CaskStructGenerator
module_function
# NOTE: this will be used to load installed cask JSON files,
# so it must never fail wi... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/github_actions_utils/public_api_check.rb | Ruby | bsd-2-clause | 47,751 | main | 3,824 | # typed: strict
# frozen_string_literal: true
# Validates that:
# 1. Style/Documentation.Include in .rubocop.yml matches files containing @api public
# 2. FORMULA_COOKBOOK_METHODS includes every rubydoc-linked method in the Formula Cookbook
# 3. CASK_COOKBOOK_METHODS includes every @api public method in the cask sourc... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/denylist.rb | Ruby | bsd-2-clause | 47,751 | main | 484 | # typed: strict
# frozen_string_literal: true
module Cask
# List of casks which are not allowed in official taps.
module Denylist
sig { params(name: String).returns(T.nilable(String)) }
def self.reason(name)
case name
when /^adobe-(after|illustrator|indesign|photoshop|premiere)/
"Adobe ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/quarantine.rb | Ruby | bsd-2-clause | 47,751 | main | 12,379 | # typed: strict
# frozen_string_literal: true
require "development_tools"
require "cask/exceptions"
require "system_command"
require "utils/output"
module Cask
# Helper module for quarantining files.
module Quarantine
extend SystemCommand::Mixin
extend ::Utils::Output::Mixin
class SigningIdentity < T... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/upgrade.rb | Ruby | bsd-2-clause | 47,751 | main | 13,886 | # typed: strict
# frozen_string_literal: true
require "env_config"
require "cask/config"
require "cask/quarantine"
require "deprecate_disable"
require "utils/output"
module Cask
class Upgrade
extend ::Utils::Output::Mixin
sig { returns(T::Array[String]) }
def self.greedy_casks
if (upgrade_greedy_... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/cask_loader.rb | Ruby | bsd-2-clause | 47,751 | main | 26,322 | # typed: strict
# frozen_string_literal: true
require "cask/cache"
require "cask/cask"
require "uri"
require "utils/curl"
require "utils/output"
require "utils/path"
require "extend/hash/keys"
require "api"
module Cask
# Loads a cask from various sources.
module CaskLoader
extend Context
extend ::Utils::O... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/exceptions.rb | Ruby | bsd-2-clause | 47,751 | main | 6,782 | # typed: strict
# frozen_string_literal: true
module Cask
# General cask error.
class CaskError < RuntimeError; end
# Cask error containing multiple other errors.
class MultipleCaskErrors < CaskError
sig { params(errors: T::Array[StandardError]).void }
def initialize(errors)
super()
@erro... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/metadata.rb | Ruby | bsd-2-clause | 47,751 | main | 3,129 | # typed: strict
# frozen_string_literal: true
require "utils/output"
module Cask
# Helper module for reading and writing cask metadata.
module Metadata
extend T::Helpers
include ::Utils::Output::Mixin
METADATA_SUBDIR = ".metadata"
TIMESTAMP_FORMAT = "%Y%m%d%H%M%S.%L"
requires_ancestor { Cask... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/dsl.rb | Ruby | bsd-2-clause | 47,751 | main | 26,420 | # typed: strict
# frozen_string_literal: true
require "autobump_constants"
require "locale"
require "livecheck"
require "utils/output"
require "cask/artifact"
require "cask/artifact_set"
require "cask/caskroom"
require "cask/exceptions"
require "cask/dsl/base"
require "cask/dsl/caveats"
require "cask/dsl/conflicts_... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/installer.rb | Ruby | bsd-2-clause | 47,751 | main | 30,625 | # typed: strict
# frozen_string_literal: true
require "formula_installer"
require "unpack_strategy"
require "utils/topological_hash"
require "utils/analytics"
require "utils/output"
require "cask/config"
require "cask/download"
require "cask/migrator"
require "cask/quarantine"
require "cask/tab"
module Cask
# Inst... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/pkg.rb | Ruby | bsd-2-clause | 47,751 | main | 4,253 | # typed: strict
# frozen_string_literal: true
require "cask/macos"
require "utils/output"
module Cask
# Helper class for uninstalling `.pkg` installers.
class Pkg
include ::Utils::Output::Mixin
sig { params(regexp: String, command: T.class_of(SystemCommand)).returns(T::Array[Pkg]) }
def self.all_matc... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/url.rb | Ruby | bsd-2-clause | 47,751 | main | 4,684 | # typed: strict
# frozen_string_literal: true
require "source_location"
module Cask
# Class corresponding to the `url` stanza.
class URL
sig { returns(URI::Generic) }
attr_reader :uri
sig { returns(T.nilable(T::Hash[T.any(Symbol, String), String])) }
attr_reader :revisions
sig { returns(T.ni... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/cache.rb | Ruby | bsd-2-clause | 47,751 | main | 247 | # typed: strict
# frozen_string_literal: true
module Cask
# Helper functions for the cask cache.
module Cache
sig { returns(Pathname) }
def self.path
@path ||= T.let(HOMEBREW_CACHE/"Cask", T.nilable(Pathname))
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact_set.rb | Ruby | bsd-2-clause | 47,751 | main | 552 | # typed: strict
# frozen_string_literal: true
module Cask
# Sorted set containing all cask artifacts.
class ArtifactSet < ::Set
extend T::Generic
Elem = type_member(:out) { { fixed: Artifact::AbstractArtifact } }
sig { params(block: T.nilable(T.proc.params(arg0: Elem).returns(T.untyped))).void }
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/cask.rb | Ruby | bsd-2-clause | 47,751 | main | 24,957 | # typed: strict
# frozen_string_literal: true
require "bundle_version"
require "cask/cask_loader"
require "cask/config"
require "cask/dsl"
require "cask/metadata"
require "cask/tab"
require "utils/output"
require "api_hashable"
module Cask
# An instance of a cask.
class Cask
extend Forwardable
extend APIH... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/download.rb | Ruby | bsd-2-clause | 47,751 | main | 4,671 | # typed: strict
# frozen_string_literal: true
require "downloadable"
require "fileutils"
require "cask/cache"
require "cask/quarantine"
module Cask
# A download corresponding to a {Cask}.
class Download
include Downloadable
include Context
sig { returns(::Cask::Cask) }
attr_reader :cask
sig... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/info.rb | Ruby | bsd-2-clause | 47,751 | main | 6,872 | # typed: strict
# frozen_string_literal: true
require "json"
require "cmd/info"
require "utils/output"
module Cask
class Info
extend ::Utils::Output::Mixin
sig { params(cask: Cask).returns(String) }
def self.get_info(cask)
require "cask/installer"
installed = cask.installed?
output =... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact.rb | Ruby | bsd-2-clause | 47,751 | main | 1,893 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/app"
require "cask/artifact/artifact" # generic 'artifact' stanza
require "cask/artifact/audio_unit_plugin"
require "cask/artifact/binary"
require "cask/artifact/colorpicker"
require "cask/artifact/dictionary"
require "cask/artifact/font"
require "ca... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/config.rb | Ruby | bsd-2-clause | 47,751 | main | 7,266 | # typed: strict
# frozen_string_literal: true
require "json"
require "lazy_object"
require "locale"
require "extend/hash/keys"
module Cask
# Configuration for installing casks.
#
# @api internal
class Config
ConfigHash = T.type_alias { T::Hash[Symbol, T.any(LazyObject, String, Pathname, T::Array[String])... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/reinstall.rb | Ruby | bsd-2-clause | 47,751 | main | 2,332 | # typed: strict
# frozen_string_literal: true
require "utils/output"
module Cask
class Reinstall
extend ::Utils::Output::Mixin
sig {
params(
casks: ::Cask::Cask, verbose: T::Boolean, force: T::Boolean, skip_cask_deps: T::Boolean, binaries: T::Boolean,
require_sha: T::Boolean, quaranti... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/macos.rb | Ruby | bsd-2-clause | 47,751 | main | 11,708 | # typed: strict
# frozen_string_literal: true
module OS
module Mac
SYSTEM_DIRS = T.let([
"/",
"/Applications",
"/Applications/Utilities",
"/Incompatible Software",
"/Library",
"/Library/Application Support",
"/Library/Audio",
"/Library/Caches",
"/Library/Colo... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/utils.rb | Ruby | bsd-2-clause | 47,751 | main | 4,215 | # typed: strict
# frozen_string_literal: true
require "utils/user"
require "open3"
require "utils/output"
module Cask
# Helper functions for various cask operations.
module Utils
extend ::Utils::Output::Mixin
BUG_REPORTS_URL = "https://github.com/Homebrew/homebrew-cask#reporting-bugs"
sig { params(p... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/caskroom.rb | Ruby | bsd-2-clause | 47,751 | main | 2,572 | # typed: strict
# frozen_string_literal: true
require "utils/user"
require "utils/output"
module Cask
# Helper functions for interacting with the `Caskroom` directory.
#
# @api internal
module Caskroom
extend ::Utils::Output::Mixin
sig { returns(Pathname) }
def self.path
@path ||= T.let(HOM... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/uninstall.rb | Ruby | bsd-2-clause | 47,751 | main | 1,734 | # typed: strict
# frozen_string_literal: true
require "cask_dependent"
require "dependents_message"
require "utils/output"
module Cask
class Uninstall
extend ::Utils::Output::Mixin
sig { params(casks: ::Cask::Cask, binaries: T::Boolean, force: T::Boolean, verbose: T::Boolean).void }
def self.uninstall_... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/staged.rb | Ruby | bsd-2-clause | 47,751 | main | 1,341 | # typed: strict
# frozen_string_literal: true
require "utils/user"
require "utils/output"
module Cask
# Helper functions for staged casks.
module Staged
include ::Utils::Output::Mixin
extend T::Helpers
requires_ancestor { ::Cask::DSL::Base }
Paths = T.type_alias { T.any(String, Pathname, T::Arra... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/migrator.rb | Ruby | bsd-2-clause | 47,751 | main | 3,034 | # typed: strict
# frozen_string_literal: true
require "utils/inreplace"
require "utils/output"
module Cask
class Migrator
include ::Utils::Output::Mixin
sig { returns(Cask) }
attr_reader :old_cask, :new_cask
sig { params(old_cask: Cask, new_cask: Cask).void }
def initialize(old_cask, new_cask)... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/audit.rb | Ruby | bsd-2-clause | 47,751 | main | 48,287 | # typed: strict
# frozen_string_literal: true
require "cask/denylist"
require "cask/download"
require "cask/installer"
require "cask/quarantine"
require "digest"
require "livecheck/livecheck"
require "source_location"
require "system_command"
require "utils/backtrace"
require "formula_name_cask_token_auditor"
require ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/tab.rb | Ruby | bsd-2-clause | 47,751 | main | 4,481 | # typed: strict
# frozen_string_literal: true
require "tab"
module Cask
class Tab < ::AbstractTab
# Sorbet type members are mutable by design and cannot be frozen.
# rubocop:disable Style/MutableConstant
Cache = type_template { { fixed: T::Hash[T.any(Pathname, String), T.untyped] } }
# rubocop:enabl... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/list.rb | Ruby | bsd-2-clause | 47,751 | main | 1,896 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/relocated"
require "utils/output"
module Cask
module List
extend ::Utils::Output::Mixin
TAP_AND_NAME_COMPARISON = T.let(
proc do |a, b|
if a.include?("/") && b.exclude?("/")
1
elsif a.exclude?("/") && b.inc... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/auditor.rb | Ruby | bsd-2-clause | 47,751 | main | 4,667 | # typed: strict
# frozen_string_literal: true
require "cask/audit"
require "utils/output"
module Cask
# Helper class for auditing all available languages of a cask.
class Auditor
include ::Utils::Output::Mixin
# TODO: use argument forwarding (...) when Sorbet supports it in strict mode
sig {
pa... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/symlinked.rb | Ruby | bsd-2-clause | 47,751 | main | 4,248 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/relocated"
module Cask
module Artifact
# Superclass for all artifacts which are installed by symlinking them to the target location.
class Symlinked < Relocated
sig { returns(String) }
def self.link_type_english_name
"S... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/binary.rb | Ruby | bsd-2-clause | 47,751 | main | 714 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/symlinked"
module Cask
module Artifact
# Artifact corresponding to the `binary` stanza.
class Binary < Symlinked
sig {
override.params(
force: T::Boolean,
adopt: T::Boolean,
command: T.cla... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/abstract_flight_block.rb | Ruby | bsd-2-clause | 47,751 | main | 1,653 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/abstract_artifact"
module Cask
module Artifact
# Abstract superclass for block artifacts.
class AbstractFlightBlock < AbstractArtifact
sig { override.returns(Symbol) }
def self.dsl_key
super.to_s.sub(/_block$/, "").to_s... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/fishcompletion.rb | Ruby | bsd-2-clause | 47,751 | main | 697 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/shellcompletion"
module Cask
module Artifact
# Artifact corresponding to the `fish_completion` stanza.
class FishCompletion < ShellCompletion
sig { override.params(target: T.any(String, Pathname), base_dir: T.nilable(Pathname)).retur... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/suite.rb | Ruby | bsd-2-clause | 47,751 | main | 390 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `suite` stanza.
class Suite < Moved
sig { override.returns(String) }
def self.english_name
"App Suite"
end
sig { override.returns(Symbol) }... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/audio_unit_plugin.rb | Ruby | bsd-2-clause | 47,751 | main | 224 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `audio_unit_plugin` stanza.
class AudioUnitPlugin < Moved
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/uninstall.rb | Ruby | bsd-2-clause | 47,751 | main | 1,484 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/abstract_uninstall"
module Cask
module Artifact
# Artifact corresponding to the `uninstall` stanza.
class Uninstall < AbstractUninstall
UPGRADE_REINSTALL_SKIP_DIRECTIVES = [:quit, :signal].freeze
sig {
params(
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/mdimporter.rb | Ruby | bsd-2-clause | 47,751 | main | 1,184 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `mdimporter` stanza.
class Mdimporter < Moved
sig { override.returns(String) }
def self.english_name
"Spotlight metadata importer"
end
sig ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/moved.rb | Ruby | bsd-2-clause | 47,751 | main | 10,000 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/relocated"
require "cask/quarantine"
module Cask
module Artifact
# Superclass for all artifacts that are installed by moving them to the target location.
class Moved < Relocated
sig { returns(String) }
def self.english_descript... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/vst_plugin.rb | Ruby | bsd-2-clause | 47,751 | main | 309 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `vst_plugin` stanza.
class VstPlugin < Moved
sig { override.returns(String) }
def self.english_name
"VST Plugin"
end
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/dictionary.rb | Ruby | bsd-2-clause | 47,751 | main | 212 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `dictionary` stanza.
class Dictionary < Moved
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/vst3_plugin.rb | Ruby | bsd-2-clause | 47,751 | main | 312 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `vst3_plugin` stanza.
class Vst3Plugin < Moved
sig { override.returns(String) }
def self.english_name
"VST3 Plugin"
end
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/abstract_artifact.rb | Ruby | bsd-2-clause | 47,751 | main | 6,520 | # typed: strict
# frozen_string_literal: true
require "extend/object/deep_dup"
require "utils/output"
module Cask
module Artifact
# Abstract superclass for all artifacts.
class AbstractArtifact
extend T::Helpers
extend ::Utils::Output::Mixin
abstract!
include Comparable
inclu... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/abstract_uninstall.rb | Ruby | bsd-2-clause | 47,751 | main | 20,929 | # typed: strict
# frozen_string_literal: true
require "timeout"
require "utils/user"
require "cask/artifact/abstract_artifact"
require "cask/pkg"
require "cask/utils/trash"
require "extend/hash/keys"
require "system_command"
module Cask
module Artifact
# Abstract superclass for uninstall artifacts.
class A... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/colorpicker.rb | Ruby | bsd-2-clause | 47,751 | main | 214 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `colorpicker` stanza.
class Colorpicker < Moved
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/bashcompletion.rb | Ruby | bsd-2-clause | 47,751 | main | 683 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/shellcompletion"
module Cask
module Artifact
# Artifact corresponding to the `bash_completion` stanza.
class BashCompletion < ShellCompletion
sig { override.params(target: T.any(String, Pathname), base_dir: T.nilable(Pathname)).retur... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/pkg.rb | Ruby | bsd-2-clause | 47,751 | main | 3,288 | # typed: strict
# frozen_string_literal: true
require "plist"
require "utils/user"
require "cask/artifact/abstract_artifact"
require "extend/hash/keys"
module Cask
module Artifact
# Artifact corresponding to the `pkg` stanza.
class Pkg < AbstractArtifact
sig { returns(Pathname) }
attr_reader :p... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/preflight_block.rb | Ruby | bsd-2-clause | 47,751 | main | 245 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/abstract_flight_block"
module Cask
module Artifact
# Artifact corresponding to the `preflight` stanza.
class PreflightBlock < AbstractFlightBlock
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/shellcompletion.rb | Ruby | bsd-2-clause | 47,751 | main | 410 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/symlinked"
module Cask
module Artifact
class ShellCompletion < Symlinked
sig { override.overridable.params(_: T.any(String, Pathname), base_dir: T.nilable(Pathname)).returns(Pathname) }
def resolve_target(_, base_dir: nil)
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/keyboard_layout.rb | Ruby | bsd-2-clause | 47,751 | main | 1,820 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `keyboard_layout` stanza.
class KeyboardLayout < Moved
sig {
override.params(
adopt: T::Boolean,
auto_updates: T.nilable(T::Boolean... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/zap.rb | Ruby | bsd-2-clause | 47,751 | main | 360 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/abstract_uninstall"
module Cask
module Artifact
# Artifact corresponding to the `zap` stanza.
class Zap < AbstractUninstall
sig { params(options: T.anything).void }
def zap_phase(**options)
dispatch_uninstall_directives... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/font.rb | Ruby | bsd-2-clause | 47,751 | main | 200 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `font` stanza.
class Font < Moved
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/screen_saver.rb | Ruby | bsd-2-clause | 47,751 | main | 215 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `screen_saver` stanza.
class ScreenSaver < Moved
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/qlplugin.rb | Ruby | bsd-2-clause | 47,751 | main | 1,819 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `qlplugin` stanza.
class Qlplugin < Moved
sig { override.returns(String) }
def self.english_name
"Quick Look Plugin"
end
sig {
over... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/postflight_block.rb | Ruby | bsd-2-clause | 47,751 | main | 247 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/abstract_flight_block"
module Cask
module Artifact
# Artifact corresponding to the `postflight` stanza.
class PostflightBlock < AbstractFlightBlock
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/manpage.rb | Ruby | bsd-2-clause | 47,751 | main | 1,150 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/symlinked"
module Cask
module Artifact
# Artifact corresponding to the `manpage` stanza.
class Manpage < Symlinked
sig { returns(String) }
attr_reader :section
sig {
override.params(
cask: Cask,... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/internet_plugin.rb | Ruby | bsd-2-clause | 47,751 | main | 221 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `internet_plugin` stanza.
class InternetPlugin < Moved
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/app.rb | Ruby | bsd-2-clause | 47,751 | main | 1,275 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `app` stanza.
class App < Moved
sig {
override.params(
adopt: T::Boolean,
auto_updates: T.nilable(T::Boolean),
force: ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/input_method.rb | Ruby | bsd-2-clause | 47,751 | main | 215 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `input_method` stanza.
class InputMethod < Moved
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/artifact.rb | Ruby | bsd-2-clause | 47,751 | main | 1,109 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Generic artifact corresponding to the `artifact` stanza.
class Artifact < Moved
sig { override.returns(String) }
def self.english_name
"Generic Artifact"
end
sig {
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/installer.rb | Ruby | bsd-2-clause | 47,751 | main | 3,269 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/abstract_artifact"
require "extend/hash/keys"
module Cask
module Artifact
# Artifact corresponding to the `installer` stanza.
class Installer < AbstractArtifact
VALID_KEYS = T.let(Set.new([
:manual,
:script,
]).... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/service.rb | Ruby | bsd-2-clause | 47,751 | main | 206 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `service` stanza.
class Service < Moved
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/zshcompletion.rb | Ruby | bsd-2-clause | 47,751 | main | 688 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/shellcompletion"
module Cask
module Artifact
# Artifact corresponding to the `zsh_completion` stanza.
class ZshCompletion < ShellCompletion
sig { override.params(target: T.any(String, Pathname), base_dir: T.nilable(Pathname)).returns... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/stage_only.rb | Ruby | bsd-2-clause | 47,751 | main | 756 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/abstract_artifact"
module Cask
module Artifact
# Artifact corresponding to the `stage_only` stanza.
class StageOnly < AbstractArtifact
sig { params(cask: Cask, args: T.anything, kwargs: T.anything).returns(StageOnly) }
def self... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/prefpane.rb | Ruby | bsd-2-clause | 47,751 | main | 311 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `prefpane` stanza.
class Prefpane < Moved
sig { override.returns(String) }
def self.english_name
"Preference Pane"
end
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/relocated.rb | Ruby | bsd-2-clause | 47,751 | main | 4,148 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/abstract_artifact"
require "extend/hash/keys"
module Cask
module Artifact
# Superclass for all artifacts which have a source and a target location.
class Relocated < AbstractArtifact
sig {
overridable.params(
cask: ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/artifact/generated_completion.rb | Ruby | bsd-2-clause | 47,751 | main | 5,342 | # typed: strict
# frozen_string_literal: true
require "cask/artifact/abstract_artifact"
require "cask/artifact/bashcompletion"
require "cask/artifact/fishcompletion"
require "cask/artifact/zshcompletion"
require "extend/hash/keys"
require "utils/shell_completion"
module Cask
module Artifact
# Artifact correspon... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/utils/trash.rb | Ruby | bsd-2-clause | 47,751 | main | 3,637 | # typed: strict
# frozen_string_literal: true
require "cask/utils"
require "fileutils"
require "system_command"
require "uri"
module Cask
module Utils
module Trash
extend SystemCommand::Mixin
sig {
params(paths: Pathname, command: T.nilable(T.class_of(SystemCommand)))
.returns([T:... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/dsl/depends_on.rb | Ruby | bsd-2-clause | 47,751 | main | 4,131 | # typed: strict
# frozen_string_literal: true
require "delegate"
require "requirements/macos_requirement"
module Cask
class DSL
# Class corresponding to the `depends_on` stanza.
class DependsOn < SimpleDelegator
VALID_KEYS = T.let(Set.new([
:formula,
:cask,
:macos,
:ar... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/dsl/base.rb | Ruby | bsd-2-clause | 47,751 | main | 1,193 | # typed: strict
# frozen_string_literal: true
module Cask
class DSL
# Superclass for all stanzas which take a block.
class Base
extend Forwardable
sig { returns(Cask) }
attr_reader :cask
sig { returns(T.class_of(SystemCommand)) }
attr_reader :command
sig { params(cask: ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/dsl/uninstall_preflight.rb | Ruby | bsd-2-clause | 47,751 | main | 232 | # typed: strict
# frozen_string_literal: true
require "cask/staged"
module Cask
class DSL
# Class corresponding to the `uninstall_preflight` stanza.
class UninstallPreflight < Base
include Staged
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/dsl/conflicts_with.rb | Ruby | bsd-2-clause | 47,751 | main | 830 | # typed: strict
# frozen_string_literal: true
require "delegate"
require "extend/hash/keys"
require "utils/output"
module Cask
class DSL
# Class corresponding to the `conflicts_with` stanza.
class ConflictsWith < SimpleDelegator
VALID_KEYS = [:cask].freeze
sig { params(options: T.anything).void... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/dsl/preflight.rb | Ruby | bsd-2-clause | 47,751 | main | 213 | # typed: strict
# frozen_string_literal: true
require "cask/staged"
module Cask
class DSL
# Class corresponding to the `preflight` stanza.
class Preflight < Base
include Staged
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/dsl/rename.rb | Ruby | bsd-2-clause | 47,751 | main | 1,252 | # typed: strict
# frozen_string_literal: true
module Cask
class DSL
# Class corresponding to the `rename` stanza.
class Rename
sig { returns(String) }
attr_reader :from, :to
sig { params(from: String, to: String).void }
def initialize(from, to)
@from = from
@to = to
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/dsl/caveats.rb | Ruby | bsd-2-clause | 47,751 | main | 7,096 | # typed: strict
# frozen_string_literal: true
module Cask
class DSL
# Class corresponding to the `caveats` stanza.
#
# Each method should handle output, following the
# convention of at least one trailing blank line so that the user
# can distinguish separate caveats.
#
# The return value... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/dsl/container.rb | Ruby | bsd-2-clause | 47,751 | main | 992 | # typed: strict
# frozen_string_literal: true
require "unpack_strategy"
module Cask
class DSL
# Class corresponding to the `container` stanza.
class Container
sig { returns(T.nilable(String)) }
attr_accessor :nested
sig { returns(T.nilable(Symbol)) }
attr_accessor :type
sig {... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/cask/dsl/postflight.rb | Ruby | bsd-2-clause | 47,751 | main | 215 | # typed: strict
# frozen_string_literal: true
require "cask/staged"
module Cask
class DSL
# Class corresponding to the `postflight` stanza.
class Postflight < Base
include Staged
end
end
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.