Class: Tapioca::Compilers::CaskConfig
- Defined in:
- sorbet/tapioca/compilers/cask/config.rb
Constant Summary collapse
- ConstantType =
type_member { { fixed: T::Module[T.anything] } }
- LINUX_ONLY_DIRS =
This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.
Dirs defined in
OS::Linux::Cask::Config::ClassMethods::DEFAULT_DIRSthat aren't visible toCask::Config.defaultswhen this compiler is run on macOS, but still need accessor methods generated in the RBI. T.let([:appimagedir].freeze, T::Array[Symbol])
Class Method Summary collapse
Instance Method Summary collapse
- #decorate ⇒ void private
Class Method Details
.gather_constants ⇒ Enumerable<T::Module[T.anything]>
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
18 |
# File 'sorbet/tapioca/compilers/cask/config.rb', line 18 def self.gather_constants = [Cask::Config] |
Instance Method Details
#decorate ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
This method returns an undefined value.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'sorbet/tapioca/compilers/cask/config.rb', line 21 def decorate keys = Cask::Config.defaults.keys | LINUX_ONLY_DIRS root.create_module("Cask") do |mod| mod.create_class("Config") do |klass| keys.each do |key| return_type = if key == :languages # :languages is a `LazyObject`, so it lazily evaluates to an # array of strings when a method is called on it. "T::Array[String]" elsif key.end_with?("?") "T::Boolean" else "String" end klass.create_method(key.to_s, return_type:, class_method: false) end end end end |