Class: Gemsmith::CLI::Actions::Publish
- Inherits:
-
Sod::Action
- Object
- Sod::Action
- Gemsmith::CLI::Actions::Publish
- Defined in:
- lib/gemsmith/cli/actions/publish.rb
Overview
Handles the publish action.
Instance Method Summary collapse
- #call(name = default) ⇒ Object
-
#initialize(publisher: Tools::Publisher.new, loader: Spek::Loader) ⇒ Publish
constructor
A new instance of Publish.
Constructor Details
#initialize(publisher: Tools::Publisher.new, loader: Spek::Loader) ⇒ Publish
Returns a new instance of Publish.
24 25 26 27 28 |
# File 'lib/gemsmith/cli/actions/publish.rb', line 24 def initialize(publisher: Tools::Publisher.new, loader: Spek::Loader, **) super(**) @publisher = publisher @loader = loader end |
Instance Method Details
#call(name = default) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/gemsmith/cli/actions/publish.rb', line 30 def call name = default case publisher.call loader.call("#{name}.gemspec") in Success(spec) then logger.info { "Published: #{spec.package_name}." } in Failure() then log_error else log_error "Publish failed, unable to parse result." end end |