class Rubysmith::CLI::Processors::Config

Handles the Command Line Interface (CLI) configuration processing.

Attributes

configuration[R]
kernel[R]

Public Class Methods

new(configuration: CLI::Configuration::Loader::CLIENT, kernel: Kernel) click to toggle source
# File lib/rubysmith/cli/processors/config.rb, line 8
def initialize configuration: CLI::Configuration::Loader::CLIENT, kernel: Kernel
  @configuration = configuration
  @kernel = kernel
end

Public Instance Methods

call(action) click to toggle source
# File lib/rubysmith/cli/processors/config.rb, line 13
def call action
  case action
    when :edit then edit
    when :view then view
    else fail StandardError, "Invalid configuration action: #{action}."
  end
end

Private Instance Methods

edit(= kernel.system("$EDITOR click to toggle source
# File lib/rubysmith/cli/processors/config.rb, line 25
    def edit = kernel.system("$EDITOR #{configuration.current}")

    def view = kernel.system("cat #{configuration.current}")
  end
end
view(= kernel.system("cat click to toggle source
# File lib/rubysmith/cli/processors/config.rb, line 27
  def view = kernel.system("cat #{configuration.current}")
end