Class: Factorix::CLI::Commands::MOD::Changelog::Release
- Inherits:
-
Base
- Object
- Dry::CLI::Command
- Base
- Factorix::CLI::Commands::MOD::Changelog::Release
- Defined in:
- lib/factorix/cli/commands/mod/changelog/release.rb
Overview
Convert the Unreleased section to a versioned release
Instance Method Summary collapse
Methods inherited from Base
backup_support!, confirmable!, inherited, require_game_stopped!
Instance Method Details
#call(version: nil, date: nil, changelog: "changelog.txt", info_json: "info.json") ⇒ void
This method returns an undefined value.
22 23 24 25 26 27 28 29 30 |
# File 'lib/factorix/cli/commands/mod/changelog/release.rb', line 22 def call(version: nil, date: nil, changelog: "changelog.txt", info_json: "info.json", **) parsed_version = resolve_version(version, Pathname(info_json)) release_date = date || Time.now.utc.strftime("%Y-%m-%d") path = Pathname(changelog) log = Factorix::Changelog.load(path) log.release_section(parsed_version, date: release_date) log.save(path) say "Converted Unreleased to #{parsed_version} (#{release_date})", prefix: :success end |