Class: Factorix::CLI::Commands::MOD::Changelog::Check

Inherits:
Base
  • Object
show all
Defined in:
lib/factorix/cli/commands/mod/changelog/check.rb

Overview

Validate the structure of a MOD changelog file

Instance Method Summary collapse

Methods inherited from Base

backup_support!, confirmable!, inherited, require_game_stopped!

Instance Method Details

#call(release: false, changelog: "changelog.txt", info_json: "info.json") ⇒ void

This method returns an undefined value.

Parameters:

  • release (Boolean) (defaults to: false)

    disallow Unreleased section

  • changelog (String) (defaults to: "changelog.txt")

    path to changelog file

  • info_json (String) (defaults to: "info.json")

    path to info.json file



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/factorix/cli/commands/mod/changelog/check.rb', line 20

def call(release: false, changelog: "changelog.txt", info_json: "info.json", **)
  errors = []

  log = parse_changelog(Pathname(changelog), errors)
  return report(errors) unless log

  validate_unreleased_position(log, errors)
  validate_version_order(log, errors)

  if release
    validate_release_mode(log, Pathname(info_json), errors)
  end

  report(errors)
end