class Versi::GenerateCommand

Public Instance Methods

execute() click to toggle source
# File lib/versi/generate_command.rb, line 12
def execute
  validate
  if debug?
    context = Versi::GenerateCommand::Interactors::BuildReleaseTag.call(options: options)
    Versi::LOG.info("No tag will be created, because we are in debug mode")
  else
    context = Versi::GenerateCommand::Interactors::GenerateCommandRelease.call(options: options)
  end
  
  if context.error
    raise context.error
  end
end

Private Instance Methods

options() click to toggle source
# File lib/versi/generate_command.rb, line 34
def options
  { type:    type,
    name:    name,
    prefix:  prefix,
    message: message,
    remote:  remote }
end
validate() click to toggle source
# File lib/versi/generate_command.rb, line 28
def validate
  if options[:type] != nil && !Versi::Util::SemanticReleaseTypes::ALL.include?(options[:type])
    raise "Invalid release type: \"#{options[:type]}\". The valid ones are: #{Versi::Util::SemanticReleaseTypes.pretty_list}"
  end
end