Class: Sod::Prefabs::Actions::Config::Create

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

Overview

Creates 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, xdg_config: nil) ⇒ Create

Returns a new instance of Create.



21
22
23
24
25
# File 'lib/sod/prefabs/actions/config/create.rb', line 21

def initialize(path = nil, xdg_config: nil, **)
  super(**)
  @xdg_config = context[xdg_config, :xdg_config]
  @path = Pathname context[path, :defaults_path]
end

Instance Method Details

#callObject



27
28
29
30
# File 'lib/sod/prefabs/actions/config/create.rb', line 27

def call(*)
  ARGV.clear
  valid_defaults? && choose
end