Class: Factorix::CLI::Commands::MOD::Edit
- Includes:
- PortalSupport
- Defined in:
- lib/factorix/cli/commands/mod/edit.rb
Overview
Edit MOD metadata on Factorio MOD Portal
Instance Method Summary collapse
-
#call(mod_name:, description: nil, summary: nil, title: nil, category: nil, tags: nil, license: nil, homepage: nil, source_url: nil, faq: nil, deprecated: nil) ⇒ void
Execute the edit command.
Methods inherited from Base
backup_support!, confirmable!, inherited, require_game_stopped!
Instance Method Details
#call(mod_name:, description: nil, summary: nil, title: nil, category: nil, tags: nil, license: nil, homepage: nil, source_url: nil, faq: nil, deprecated: nil) ⇒ void
This method returns an undefined value.
Execute the edit command
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/factorix/cli/commands/mod/edit.rb', line 45 def call(mod_name:, description: nil, summary: nil, title: nil, category: nil, tags: nil, license: nil, homepage: nil, source_url: nil, faq: nil, deprecated: nil, **) validate_license!(license) if license = ( description:, summary:, title:, category:, tags:, license:, homepage:, source_url:, faq:, deprecated: ) if .empty? say "At least one metadata option must be provided", prefix: :error say "Available options: --description, --summary, --title, --category, --tags, --license, --homepage, --source-url, --faq, --deprecated" raise InvalidArgumentError, "No metadata options provided" end portal.edit_mod(mod_name, **) say "Metadata updated successfully!", prefix: :success end |