Class: Sod::Prefabs::Actions::Config::Edit
- Defined in:
- lib/sod/prefabs/actions/config/edit.rb
Overview
Edits project configuration.
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(path = nil) ⇒ Edit
constructor
:reek:ControlParameter.
Methods inherited from Action
ancillary, default, description, inherited, #inspect, on, #to_proc
Constructor Details
#initialize(path = nil) ⇒ Edit
:reek:ControlParameter
20 21 22 23 |
# File 'lib/sod/prefabs/actions/config/edit.rb', line 20 def initialize(path = nil, **) super(**) @path = Pathname(path || context.xdg_config.active) end |
Instance Method Details
#call ⇒ Object
25 26 27 28 29 30 |
# File 'lib/sod/prefabs/actions/config/edit.rb', line 25 def call(*) return unless check logger.info { "Editing: #{path.to_s.inspect}." } kernel.system "$EDITOR #{path}" end |