class ConfigmonkeyCli::Application::ManifestAction::Template
Public Instance Methods
_perform_directory(source, destination, opts)
click to toggle source
# File lib/configmonkey_cli/application/manifest_actions/template.rb, line 23 def _perform_directory(source, destination, opts) status :invalid, :red, "directory not allowed for template", :red end
_perform_file(source, destination, opts)
click to toggle source
# File lib/configmonkey_cli/application/manifest_actions/template.rb, line 27 def _perform_file(source, destination, opts) hostname = app.opts[:hostname] thor.template(@source, @destination, @opts.merge(context: binding)) end
init(hargs_and_opts = {})
click to toggle source
# File lib/configmonkey_cli/application/manifest_actions/template.rb, line 5 def init hargs_and_opts = {} @args, @opts = args_and_opts(hargs_and_opts) end
prepare()
click to toggle source
# File lib/configmonkey_cli/application/manifest_actions/template.rb, line 9 def prepare @opts[:force] = app.opts[:default_yes] @source = @args[0] @destination = File.join(thor.destination_root, @args[1]) end
simulate()
click to toggle source
# File lib/configmonkey_cli/application/manifest_actions/template.rb, line 15 def simulate if thor.options[:pretend] destructive else status :fake, :black, rel(@destination) end end