Class: Homebrew::InstallSteps::DSL Private

Inherits:
Object
  • Object
show all
Defined in:
install_steps.rb

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(default_base: nil, default_source_base: nil, default_target_base: nil) ⇒ 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.

Parameters:



79
80
81
82
83
84
85
86
# File 'install_steps.rb', line 79

def initialize(default_base: nil, default_source_base: nil, default_target_base: nil)
  @default_base = default_base
  @default_source_base = default_source_base
  @default_target_base = default_target_base
  @steps = ::T.let([], Steps)
  @guards = ::T.let([], PathSpecs)
  @next_guard_id = ::T.let(0, ::Integer)
end

Instance Attribute Details

#stepsSteps (readonly)

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.

Returns:



89
90
91
# File 'install_steps.rb', line 89

def steps
  @steps
end

Class Method Details

.build(default_base: nil, default_source_base: nil, default_target_base: nil, &block) ⇒ Steps

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.

Parameters:

Returns:



120
121
122
123
124
# File 'install_steps.rb', line 120

def self.build(default_base: nil, default_source_base: nil, default_target_base: nil, &block)
  dsl = new(default_base:, default_source_base:, default_target_base:)
  dsl.instance_eval(&block) if block
  dsl.steps
end

.normalise_steps(steps) ⇒ Steps

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.

Parameters:

Returns:



159
160
161
162
163
164
165
166
167
# File 'install_steps.rb', line 159

def self.normalise_steps(steps)
  steps.map do |step|
    step = step.to_h do |key, value|
      key = key.to_s
      [key, normalise_step_value(key, value)]
    end
    compact_step(step)
  end
end

Instance Method Details

#bootstrap_cpythonvoid

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.



781
782
783
# File 'install_steps.rb', line 781

def bootstrap_cpython
  add_step("bootstrap_cpython")
end

#bootstrap_pypy(abi_version:) ⇒ 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.

Parameters:



786
787
788
# File 'install_steps.rb', line 786

def bootstrap_pypy(abi_version:)
  add_step("bootstrap_pypy", "abi_version" => abi_version)
end

#change_dylib_id(source, id, base: nil, resolve_source: false) ⇒ 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.

Parameters:



664
665
666
667
668
669
# File 'install_steps.rb', line 664

def change_dylib_id(source, id, base: nil, resolve_source: false)
  add_step("change_dylib_id",
           "source"         => path_spec(source, base:, default_base: @default_source_base),
           "id"             => id.to_s,
           "resolve_source" => resolve_source)
end

#compile_gsettings_schemasvoid

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.



549
550
551
# File 'install_steps.rb', line 549

def compile_gsettings_schemas
  add_rebuild_action("compile_gsettings_schemas", "share/glib-2.0/schemas")
end

#configure_clang_systemvoid

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.



771
772
773
# File 'install_steps.rb', line 771

def configure_clang_system
  add_step("configure_clang_system")
end

#configure_gcc_runtimevoid

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.



747
748
749
# File 'install_steps.rb', line 747

def configure_gcc_runtime
  add_step("configure_gcc_runtime")
end

#configure_glibc_runtimevoid

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.



766
767
768
# File 'install_steps.rb', line 766

def configure_glibc_runtime
  add_step("configure_glibc_runtime")
end

#configure_phpvoid

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.



776
777
778
# File 'install_steps.rb', line 776

def configure_php
  add_step("configure_php")
end

#copy(source, target, source_base: nil, target_base: nil, recursive: false, overwrite: true, source_glob: false) ⇒ 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.

Parameters:



308
309
310
311
312
313
314
315
316
# File 'install_steps.rb', line 308

def copy(source, target, source_base: nil, target_base: nil, recursive: false, overwrite: true,
         source_glob: false)
  add_step("copy",
           "source"      => path_spec(source, base: source_base, default_base: @default_source_base),
           "target"      => path_spec(target, base: target_base, default_base: @default_target_base),
           "recursive"   => recursive,
           "overwrite"   => (false unless overwrite),
           "source_glob" => source_glob)
end

#delete_keychain_certificate(name, matching_certificate: nil, base: nil) ⇒ 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.

odeprecated

Parameters:



604
605
606
607
608
609
# File 'install_steps.rb', line 604

def delete_keychain_certificate(name, matching_certificate: nil, base: nil)
  add_step("delete_keychain_certificate",
           "name"                 => name,
           "matching_certificate" => (path_spec(matching_certificate, base:, default_base: nil) if
             matching_certificate))
end

#delete_keychain_certificates(name, fingerprint_of: nil, base: nil) ⇒ 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.

Parameters:



618
619
620
621
622
# File 'install_steps.rb', line 618

def delete_keychain_certificates(name, fingerprint_of: nil, base: nil)
  add_step("delete_keychain_certificate",
           "name"                 => name,
           "matching_certificate" => (path_spec(fingerprint_of, base:, default_base: nil) if fingerprint_of))
end

#formula_nameString

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.

Returns:



98
99
100
# File 'install_steps.rb', line 98

def formula_name
  "{{formula_name}}"
end

#gdk_pixbuf_query_loadersvoid

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.

odeprecated



566
567
568
# File 'install_steps.rb', line 566

def gdk_pixbuf_query_loaders
  add_step("gdk_pixbuf_query_loaders")
end

#gio_querymodulesvoid

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.

odeprecated



555
556
557
# File 'install_steps.rb', line 555

def gio_querymodules
  add_rebuild_action("gio_querymodules", "lib/gio/modules")
end

#gtk_update_icon_cachevoid

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.

odeprecated



577
578
579
# File 'install_steps.rb', line 577

def gtk_update_icon_cache
  add_rebuild_action("gtk_update_icon_cache", "share/icons/hicolor")
end

#if_path_exists(path, base: nil, &block) ⇒ 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.

Parameters:



133
134
135
# File 'install_steps.rb', line 133

def if_path_exists(path, base: nil, &block)
  with_guard(path_spec(path, base:, default_base: @default_base).merge("condition" => "if_exists"), &block)
end

#init_data_dir(path, using:, base: nil, locale: nil) ⇒ 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.

Parameters:



535
536
537
538
539
540
541
542
543
544
545
546
# File 'install_steps.rb', line 535

def init_data_dir(path, using:, base: nil, locale: nil)
  using = case using.to_s
  when "postgresql" then "postgresql_initdb"
  when "mysql" then "mysql_initialize"
  when "mariadb" then "mariadb_install_db"
  else using.to_s
  end
  add_step("init_data_dir",
           "path"   => path_spec(path, base:, default_base: @default_base),
           "using"  => using,
           "locale" => locale)
end

#inreplace(path, before, after, base: nil, audit_result: true, global: true) ⇒ 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.

Parameters:



348
349
350
351
352
353
354
355
356
357
# File 'install_steps.rb', line 348

def inreplace(path, before, after, base: nil, audit_result: true, global: true)
  add_step("inreplace",
           "path"           => path_spec(path, base:, default_base: @default_base),
           "before"         => before.is_a?(::Regexp) ? before.source : before,
           "after"          => after,
           "regexp"         => before.is_a?(::Regexp),
           "regexp_options" => (before.options if before.is_a?(::Regexp)),
           "skip_audit"     => !audit_result,
           "first_only"     => !global)
end

#install_gzipped_executable(source, target, source_base: nil, target_base: nil) ⇒ 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.

Parameters:



759
760
761
762
763
# File 'install_steps.rb', line 759

def install_gzipped_executable(source, target, source_base: nil, target_base: nil)
  add_step("install_gzipped_executable",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target, base: target_base, default_base: @default_target_base))
end

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.

odeprecated

Parameters:



466
467
468
469
470
471
472
# File 'install_steps.rb', line 466

def link_children(source, target = nil, source_base: nil, target_base: :homebrew_prefix, prefix: "", suffix: "")
  add_step("link_children",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target || source, base: target_base, default_base: @default_target_base),
           "prefix" => prefix,
           "suffix" => suffix)
end

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.

odeprecated

Parameters:



435
436
437
438
439
# File 'install_steps.rb', line 435

def link_dir(source, target, source_base: nil, target_base: :homebrew_prefix)
  add_step("link_dir",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target, base: target_base, default_base: @default_target_base))
end

#ln_s(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil, force: false, uninstall: false) ⇒ 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.

odeprecated

Parameters:



404
405
406
407
# File 'install_steps.rb', line 404

def ln_s(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil,
         force: false, uninstall: false)
  symlink(source, target, source_base:, target_base:, source_formula:, target_formula:, force:, uninstall:)
end

#ln_sf(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil, uninstall: false) ⇒ 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.

odeprecated

Parameters:



421
422
423
424
# File 'install_steps.rb', line 421

def ln_sf(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil,
          uninstall: false)
  symlink(source, target, source_base:, target_base:, source_formula:, target_formula:, force: true, uninstall:)
end

#mkdir(path, base: nil) ⇒ 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.

odeprecated

Parameters:



230
231
232
# File 'install_steps.rb', line 230

def mkdir(path, base: nil)
  add_step("mkdir", "path" => path_spec(path, base:, default_base: @default_base))
end

#mkdir_p(path, base: nil) ⇒ 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.

Parameters:



235
236
237
# File 'install_steps.rb', line 235

def mkdir_p(path, base: nil)
  add_step("mkdir_p", "path" => path_spec(path, base:, default_base: @default_base))
end

#move(source, target, source_base: nil, target_base: nil, force: false, overwrite: true, source_glob: false) ⇒ void Also known as: mv

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.

Parameters:



256
257
258
259
260
261
262
263
# File 'install_steps.rb', line 256

def move(source, target, source_base: nil, target_base: nil, force: false, overwrite: true, source_glob: false)
  add_step("move",
           "source"      => path_spec(source, base: source_base, default_base: @default_source_base),
           "target"      => path_spec(target, base: target_base, default_base: @default_target_base),
           "force"       => force,
           "overwrite"   => overwrite,
           "source_glob" => source_glob)
end

#move_children(source, target, source_base: nil, target_base: nil) ⇒ 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.

odeprecated

Parameters:



277
278
279
280
281
# File 'install_steps.rb', line 277

def move_children(source, target, source_base: nil, target_base: nil)
  add_step("move_children",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target, base: target_base, default_base: @default_target_base))
end

#move_contents(source, target, source_base: nil, target_base: nil) ⇒ 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.

Parameters:



291
292
293
294
295
# File 'install_steps.rb', line 291

def move_contents(source, target, source_base: nil, target_base: nil)
  add_step("move_contents",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target, base: target_base, default_base: @default_target_base))
end

#nameString

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.

odeprecated

Returns:



93
94
95
# File 'install_steps.rb', line 93

def name
  "{{name}}"
end

#on_linux(&block) ⇒ 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.

Parameters:

  • block (::T.proc.void)


154
155
156
# File 'install_steps.rb', line 154

def on_linux(&block)
  with_guard({ "condition" => "on", "value" => "linux" }, &block)
end

#on_macos(&block) ⇒ 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.

Parameters:

  • block (::T.proc.void)


149
150
151
# File 'install_steps.rb', line 149

def on_macos(&block)
  with_guard({ "condition" => "on", "value" => "macos" }, &block)
end

#remove(paths, base: nil, recursive: false, sudo: false, symlink_target_contains: nil, content_contains: nil) ⇒ 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.

Parameters:

  • paths (Paths)
  • base (::T.nilable(::T.any(::String, ::Symbol))) (defaults to: nil)
  • recursive (::T::Boolean) (defaults to: false)
  • sudo (::T.any(::T::Boolean, ::Symbol)) (defaults to: false)
  • symlink_target_contains (::T.nilable(::String)) (defaults to: nil)
  • content_contains (::T.nilable(::String)) (defaults to: nil)


328
329
330
331
332
333
334
335
336
# File 'install_steps.rb', line 328

def remove(paths, base: nil, recursive: false, sudo: false, symlink_target_contains: nil,
           content_contains: nil)
  add_step("remove",
           "paths"                   => path_specs(paths, base:, default_base: @default_base),
           "recursive"               => recursive,
           "sudo"                    => sudo.is_a?(::Symbol) ? sudo.to_s : sudo,
           "symlink_target_contains" => symlink_target_contains,
           "content_contains"        => content_contains)
end

#run(command, args: [], base: nil, env: {}, sudo: false, must_succeed: true, print_stdout: false, print_stderr: true, stdin_path: nil, stdout_path: nil, chdir: nil, writable_paths: [], writable_base: nil, network_access: false) ⇒ 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.

Parameters:



689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
# File 'install_steps.rb', line 689

def run(command, args: [], base: nil, env: {}, sudo: false, must_succeed: true, print_stdout: false,
        print_stderr: true, stdin_path: nil, stdout_path: nil, chdir: nil, writable_paths: [],
        writable_base: nil, network_access: false)
  add_step("run",
           "command"         => path_spec(command, base:, default_base: nil),
           "args"            => args.map(&:to_s),
           "env"             => env,
           "sudo"            => sudo,
           "allow_failure"   => !must_succeed,
           "print_stdout"    => print_stdout,
           "suppress_stderr" => !print_stderr,
           "stdin_path"      => optional_path_spec(stdin_path, default_base: @default_base),
           "stdout_path"     => optional_path_spec(stdout_path, default_base: @default_base),
           "chdir"           => optional_path_spec(chdir, default_base: @default_base),
           "writable_paths"  => path_specs(
             writable_paths,
             base:         writable_base,
             default_base: @default_base,
           ),
           "network_access"  => network_access)
end

#set_ownership(paths, user: nil, group: "staff", base: nil, recursive: true) ⇒ 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.

Parameters:



648
649
650
651
652
653
654
# File 'install_steps.rb', line 648

def set_ownership(paths, user: nil, group: "staff", base: nil, recursive: true)
  add_step("set_ownership",
           "paths"         => path_specs(paths, base:, default_base: @default_base),
           "user"          => user,
           "group"         => (group if group != "staff"),
           "non_recursive" => !recursive)
end

#set_permissions(paths, permissions, base: nil, recursive: true) ⇒ 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.

Parameters:



632
633
634
635
636
637
# File 'install_steps.rb', line 632

def set_permissions(paths, permissions, base: nil, recursive: true)
  add_step("set_permissions",
           "paths"         => path_specs(paths, base:, default_base: @default_base),
           "permissions"   => permissions,
           "non_recursive" => !recursive)
end

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.

Parameters:

  • source (::T.any(::String, ::Pathname))
  • target (::T.any(::String, ::Pathname))
  • source_base (::T.nilable(::T.any(::String, ::Symbol))) (defaults to: nil)
  • target_base (::T.nilable(::T.any(::String, ::Symbol))) (defaults to: nil)
  • source_formula (::T.nilable(::String)) (defaults to: nil)
  • target_formula (::T.nilable(::String)) (defaults to: nil)
  • force (::T::Boolean) (defaults to: false)
  • uninstall (::T::Boolean) (defaults to: false)
  • overwrite (::T::Boolean) (defaults to: false)
  • remove_on_uninstall (::T::Boolean) (defaults to: false)
  • source_glob (::T::Boolean) (defaults to: false)
  • sudo (::T.any(::T::Boolean, ::Symbol)) (defaults to: false)


377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'install_steps.rb', line 377

def symlink(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil,
            force: false, uninstall: false, overwrite: false, remove_on_uninstall: false,
            source_glob: false, sudo: false)
  add_step("symlink",
           "source"      => path_spec(source, base: source_base, formula: source_formula,
                              default_base: @default_source_base),
           "target"      => path_spec(target, base: target_base, formula: target_formula,
                              default_base: @default_target_base),
           "force"       => (true if force || overwrite),
           "uninstall"   => (true if uninstall || remove_on_uninstall),
           "source_glob" => source_glob,
           "sudo"        => sudo.is_a?(::Symbol) ? sudo.to_s : sudo)
end

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.

Parameters:



484
485
486
487
488
489
490
491
# File 'install_steps.rb', line 484

def symlink_children(source, target = nil, source_base: nil, target_base: :homebrew_prefix, prefix: "",
                     suffix: "")
  add_step("link_children",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target || source, base: target_base, default_base: @default_target_base),
           "prefix" => prefix,
           "suffix" => suffix)
end

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.

Parameters:



449
450
451
452
453
# File 'install_steps.rb', line 449

def symlink_tree(source, target, source_base: nil, target_base: :homebrew_prefix)
  add_step("link_dir",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target, base: target_base, default_base: @default_target_base))
end

#terminate_process(name, match: :name, sudo: false, attempts: 1, must_succeed: false, notices: [], failure_message: nil) ⇒ 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.

Parameters:

  • name (::String)
  • match (::T.any(::String, ::Symbol)) (defaults to: :name)
  • sudo (::T::Boolean) (defaults to: false)
  • attempts (::Integer) (defaults to: 1)
  • must_succeed (::T::Boolean) (defaults to: false)
  • notices (::T::Array[::String]) (defaults to: [])
  • failure_message (::T.nilable(::String)) (defaults to: nil)


722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
# File 'install_steps.rb', line 722

def terminate_process(name, match: :name, sudo: false, attempts: 1, must_succeed: false,
                      notices: [], failure_message: nil)
  ::Kernel.raise ::ArgumentError, "terminate_process attempts must be positive" if attempts < 1

  match = match.to_s
  unless %w[name full].include?(match)
    ::Kernel.raise ::ArgumentError, "terminate_process match must be :name or :full"
  end

  add_step("terminate_process",
           "name"            => name,
           "match"           => (match if match != "name"),
           "sudo"            => sudo,
           "attempts"        => (attempts if attempts != 1),
           "must_succeed"    => must_succeed,
           "notices"         => notices,
           "failure_message" => failure_message)
end

#tokenString

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.

Returns:



103
104
105
# File 'install_steps.rb', line 103

def token
  "{{token}}"
end

#touch(path, base: nil) ⇒ 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.

Parameters:



240
241
242
# File 'install_steps.rb', line 240

def touch(path, base: nil)
  add_step("touch", "path" => path_spec(path, base:, default_base: @default_base))
end

#unless_path_exists(path, base: nil, &block) ⇒ 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.

Parameters:



144
145
146
# File 'install_steps.rb', line 144

def unless_path_exists(path, base: nil, &block)
  with_guard(path_spec(path, base:, default_base: @default_base).merge("condition" => "unless_exists"), &block)
end

#update_desktop_databasevoid

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.



592
593
594
# File 'install_steps.rb', line 592

def update_desktop_database
  add_rebuild_action("update_desktop_database", "share/applications")
end

#update_gdk_pixbuf_loaders_cachevoid

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.



571
572
573
# File 'install_steps.rb', line 571

def update_gdk_pixbuf_loaders_cache
  add_step("gdk_pixbuf_query_loaders")
end

#update_gio_modules_cachevoid

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.



560
561
562
# File 'install_steps.rb', line 560

def update_gio_modules_cache
  add_rebuild_action("gio_querymodules", "lib/gio/modules")
end

#update_gtk_icon_cachevoid

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.



582
583
584
# File 'install_steps.rb', line 582

def update_gtk_icon_cache
  add_rebuild_action("gtk_update_icon_cache", "share/icons/hicolor")
end

#update_mime_databasevoid

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.



587
588
589
# File 'install_steps.rb', line 587

def update_mime_database
  add_rebuild_action("update_mime_database", "share/mime")
end

#versionTemplateVersion

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.

Returns:

  • (TemplateVersion)


108
109
110
# File 'install_steps.rb', line 108

def version
  TEMPLATE_VERSION
end

#warn(message) ⇒ 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.

Parameters:



742
743
744
# File 'install_steps.rb', line 742

def warn(message)
  add_step("warn", "message" => message)
end

#write(path, content, base: nil, overwrite: false) ⇒ 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.

odeprecated

Parameters:



502
503
504
505
506
507
508
# File 'install_steps.rb', line 502

def write(path, content, base: nil, overwrite: false)
  content = "#{content}\n" unless content.end_with?("\n")
  add_step("write",
           "path"      => path_spec(path, base:, default_base: @default_base),
           "content"   => content,
           "overwrite" => (true if overwrite))
end

#write_file(path, content, base: nil, overwrite: true, append_newline: false) ⇒ 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.

Parameters:



519
520
521
522
523
524
525
# File 'install_steps.rb', line 519

def write_file(path, content, base: nil, overwrite: true, append_newline: false)
  content = "#{content}\n" if append_newline && !content.end_with?("\n")
  add_step("write",
           "path"      => path_spec(path, base:, default_base: @default_base),
           "content"   => content,
           "overwrite" => (true if overwrite))
end