lib/rubysmith/cli/actions/config.rb in rubysmith-0.16.1 vs lib/rubysmith/cli/actions/config.rb in rubysmith-1.0.0
- old
+ new
@@ -3,20 +3,20 @@
module Rubysmith
module CLI
module Actions
# Handles the config action.
class Config
- def initialize client: CLI::Configuration::Loader::CLIENT, container: Container
+ def initialize client: Configuration::Loader::CLIENT, container: Container
@client = client
@container = container
end
def call selection
case selection
when :edit then edit
when :view then view
- else fail StandardError, "Invalid configuration selection: #{selection}."
+ else logger.error { "Invalid configuration selection: #{selection}." }
end
end
private
@@ -25,9 +25,11 @@
def edit = kernel.system("$EDITOR #{client.current}")
def view = kernel.system("cat #{client.current}")
def kernel = container[__method__]
+
+ def logger = container[__method__]
end
end
end
end