Class: Homebrew::InstallSteps::DSL Private
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
- #steps ⇒ Steps readonly private
Class Method Summary collapse
- .build(default_base: nil, default_source_base: nil, default_target_base: nil, &block) ⇒ Steps private
- .normalise_steps(steps) ⇒ Steps private
Instance Method Summary collapse
- #initialize(default_base: nil, default_source_base: nil, default_target_base: nil) ⇒ void constructor private
- #ln_s(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil, force: false, uninstall: false) ⇒ void private
- #ln_sf(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil, uninstall: false) ⇒ void private
- #mkdir(path, base: nil) ⇒ void private
- #mkdir_p(path, base: nil) ⇒ void private
- #move(source, target, source_base: nil, target_base: nil, force: false) ⇒ void (also: #mv) private
- #move_children(source, target, source_base: nil, target_base: nil) ⇒ void private
- #symlink(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil, force: false, uninstall: false) ⇒ void private
- #touch(path, base: nil) ⇒ void private
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.
22 23 24 25 26 27 |
# File 'install_steps.rb', line 22 def initialize(default_base: nil, default_source_base: nil, default_target_base: nil) @default_base = ::T.let(default_base, ::T.nilable(::T.any(::String, ::Symbol))) @default_source_base = ::T.let(default_source_base, ::T.nilable(::T.any(::String, ::Symbol))) @default_target_base = ::T.let(default_target_base, ::T.nilable(::T.any(::String, ::Symbol))) @steps = ::T.let([], Steps) end |
Instance Attribute Details
#steps ⇒ Steps (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.
30 31 32 |
# File 'install_steps.rb', line 30 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.
40 41 42 43 44 |
# File 'install_steps.rb', line 40 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.
47 48 49 50 51 |
# File 'install_steps.rb', line 47 def self.normalise_steps(steps) steps.map do |step| ::T.cast(::Utils.deep_stringify_symbols(step), Step) end end |
Instance Method Details
#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.
135 136 137 138 |
# File 'install_steps.rb', line 135 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.
151 152 153 154 |
# File 'install_steps.rb', line 151 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.
54 55 56 |
# File 'install_steps.rb', line 54 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.
59 60 61 |
# File 'install_steps.rb', line 59 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) ⇒ 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.
77 78 79 80 81 82 |
# File 'install_steps.rb', line 77 def move(source, target, source_base: nil, target_base: nil, force: 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) 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.
94 95 96 97 98 |
# File 'install_steps.rb', line 94 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 |
#symlink(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.
112 113 114 115 116 117 118 119 120 121 |
# File 'install_steps.rb', line 112 def symlink(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil, force: false, uninstall: 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" => force, "uninstall" => uninstall) 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.
64 65 66 |
# File 'install_steps.rb', line 64 def touch(path, base: nil) add_step("touch", "path" => path_spec(path, base:, default_base: @default_base)) end |