Sha256: f70bd3e520b5a1755fca6b8bafc661484ae25a9e54b392879749cbfe9d5cc94b
Contents?: true
Size: 856 Bytes
Versions: 7
Compression:
Stored size: 856 Bytes
Contents
# frozen_string_literal: true module Milestoner module CLI module Actions # Handles the gem configuration action. class Config def initialize configuration: Configuration::Loader::HANDLER, container: Container @configuration = configuration @container = container end def call action case action when :edit then edit when :view then view else logger.error { "Invalid configuration action: #{action}." } end end private attr_reader :configuration, :container def edit = kernel.system("$EDITOR #{configuration.current}") def view = kernel.system("cat #{configuration.current}") def kernel = container[__method__] def logger = container[__method__] end end end end
Version data entries
7 entries across 7 versions & 1 rubygems