lib/rubysmith/cli/actions/publish.rb in rubysmith-5.9.0 vs lib/rubysmith/cli/actions/publish.rb in rubysmith-6.0.0
- old
+ new
@@ -1,28 +1,31 @@
# frozen_string_literal: true
-require "refinements/structs"
+require "milestoner"
+require "refinements/struct"
require "sod"
module Rubysmith
module CLI
module Actions
# Publishes project.
class Publish < Sod::Action
include Import[:input]
- using ::Refinements::Structs
+ using ::Refinements::Struct
- description "Publish project."
+ description "Publish milestone."
- on %w[-p --publish], argument: "VERSION"
+ on %w[-p --publish], argument: "[VERSION]"
+ default { Milestoner::Commits::Versioner.new.call }
+
def initialize(extension: Extensions::Milestoner, **)
super(**)
@extension = extension
end
- def call(version) = extension.call input.merge(project_version: version)
+ def call(version = nil) = extension.call input.merge(project_version: version || default)
private
attr_reader :extension
end