Class: Tapioca::ConfigBuilder

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/tapioca/config_builder.rb

Constant Summary collapse

DEFAULT_OPTIONS =
T.let({
  "postrequire" => Config::DEFAULT_POSTREQUIRE,
  "outdir" => nil,
  "exclude" => [],
  "exclude_generators" => [],
  "typed_overrides" => Config::DEFAULT_OVERRIDES,
  "todos_path" => Config::DEFAULT_TODOSPATH,
  "generators" => [],
  "file_header" => true,
  "doc" => false,
}.freeze, T::Hash[String, T.untyped])

Class Method Summary collapse

Class Method Details

.from_options(command, options) ⇒ Object


12
13
14
15
16
17
18
19
20
# File 'lib/tapioca/config_builder.rb', line 12

def from_options(command, options)
  merged_options = merge_options(default_options(command), config_options, options)

  puts(<<~MSG) if merged_options.include?("generate_command")
    DEPRECATION: The `-c` and `--cmd` flags will be removed in a future release.
  MSG

  Config.from_hash(merged_options)
end