Class: Sod::Prefabs::Actions::Config::View

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

Overview

Displays 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) ⇒ View

:reek:ControlParameter



20
21
22
23
# File 'lib/sod/prefabs/actions/config/view.rb', line 20

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

Instance Method Details

#callObject



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

def call(*)
  return unless check

  logger.info { "Viewing (#{path.to_s.inspect}):" }
  io.puts path.read
end