Class: ConfigmonkeyCli::Application::ManifestAction::Inplace

Inherits:
Base
  • Object
show all
Defined in:
lib/configmonkey_cli/application/manifest_actions/inplace.rb

Instance Attribute Summary

Attributes inherited from Base

#app, #args, #manifest, #opts, #thor

Instance Method Summary collapse

Methods inherited from Base

#args_and_opts, #exists?, #expand_dst, #expand_src, #initialize, #rel, #to_s

Constructor Details

This class inherits a constructor from ConfigmonkeyCli::Application::ManifestAction::Base

Instance Method Details

#destructiveObject



22
23
24
# File 'lib/configmonkey_cli/application/manifest_actions/inplace.rb', line 22

def destructive
  instance_exec(manifest, self, &@block)
end

#init(label = nil, &block) ⇒ Object



5
6
7
8
# File 'lib/configmonkey_cli/application/manifest_actions/inplace.rb', line 5

def init label = nil, &block
  @label = label
  @block = block
end

#inspectObject



10
11
12
# File 'lib/configmonkey_cli/application/manifest_actions/inplace.rb', line 10

def inspect
  @label ? super.gsub("Custom @args", "Custom @label=#{@label} @args") : super
end

#prepareObject



14
15
16
# File 'lib/configmonkey_cli/application/manifest_actions/inplace.rb', line 14

def prepare
  status :proc, :yellow, (@label || "unlabeled inplace block"), :blue
end

#simulateObject



18
19
20
# File 'lib/configmonkey_cli/application/manifest_actions/inplace.rb', line 18

def simulate
  destructive
end