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(xdg_config = nil, defaults_path: 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(xdg_config = nil, defaults_path: nil, **)
  super(**)
  @xdg_config = context[xdg_config, :xdg_config]
  @defaults_path = Pathname context[defaults_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
  check_defaults && choose
end