lib/gemsmith/cli/actions/edit.rb in gemsmith-17.0.1 vs lib/gemsmith/cli/actions/edit.rb in gemsmith-18.0.0
- old
+ new
@@ -6,16 +6,18 @@
module Gemsmith
module CLI
module Actions
# Handles the edit action for editing an installed gem.
class Edit
+ include Gemsmith::Import[:kernel, :logger]
include Dry::Monads[:result]
- def initialize picker: Spek::Picker, editor: Tools::Editor.new, container: Container
+ def initialize picker: Spek::Picker, editor: Tools::Editor.new, **dependencies
+ super(**dependencies)
+
@picker = picker
@editor = editor
- @container = container
end
def call gem_name
case picker.call(gem_name).bind { |spec| editor.call spec }
in Success(spec) then logger.info { "Editing: #{spec.named_version}." }
@@ -24,16 +26,12 @@
end
end
private
- attr_reader :picker, :editor, :container
+ attr_reader :picker, :editor
def error(&) = logger.error(&)
-
- def kernel = container[__method__]
-
- def logger = container[__method__]
end
end
end
end