Class: Sod::Prefabs::Actions::Config::Delete

Inherits:
Action
  • Object
show all
Defined in:
lib/sod/prefabs/actions/config/delete.rb

Overview

Deletes project configuration.

Instance Attribute Summary

Attributes inherited from Action

#record

Instance Method Summary collapse

Methods inherited from Action

ancillary, default, description, inherited, #inspect, on, #to_proc

Constructor Details

#initialize(path = nil) ⇒ Delete

:reek:ControlParameter



24
25
26
27
# File 'lib/sod/prefabs/actions/config/delete.rb', line 24

def initialize(path = nil, **)
  super(**)
  @path = Pathname(path || context.xdg_config.active)
end

Instance Method Details

#callObject



29
30
31
32
33
34
35
# File 'lib/sod/prefabs/actions/config/delete.rb', line 29

def call(*)
  ARGV.clear

  return confirm if path.exist?

  logger.warn { "Skipped. Configuration doesn't exist: #{path_info}." }
end