lib/gemsmith/cli/actions/publish.rb in gemsmith-17.0.1 vs lib/gemsmith/cli/actions/publish.rb in gemsmith-18.0.0
- old
+ new
@@ -6,16 +6,18 @@
module Gemsmith
module CLI
module Actions
# Handles the publish action.
class Publish
+ include Gemsmith::Import[:logger]
include Dry::Monads[:result]
- def initialize publisher: Tools::Publisher.new, loader: Spek::Loader, container: Container
+ def initialize publisher: Tools::Publisher.new, loader: Spek::Loader, **dependencies
+ super(**dependencies)
+
@publisher = publisher
@loader = loader
- @container = container
end
def call configuration
case publisher.call loader.call("#{configuration.project_name}.gemspec")
in Success(spec) then logger.info { "Published: #{spec.package_name}." }
@@ -24,14 +26,12 @@
end
end
private
- attr_reader :publisher, :loader, :container
+ attr_reader :publisher, :loader
def error(&) = logger.error(&)
-
- def logger = container[__method__]
end
end
end
end