Class: Lutaml::Xsd::Commands::NamespaceCommand::RemapCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/lutaml/xsd/commands/namespace_command.rb

Overview

Remap command implementation

Instance Attribute Summary

Attributes inherited from BaseCommand

#options

Instance Method Summary collapse

Constructor Details

#initialize(package_file, options) ⇒ RemapCommand

Returns a new instance of RemapCommand.



519
520
521
522
# File 'lib/lutaml/xsd/commands/namespace_command.rb', line 519

def initialize(package_file, options)
  super(options)
  @package_file = package_file
end

Instance Method Details

#runObject



524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'lib/lutaml/xsd/commands/namespace_command.rb', line 524

def run
  repository = load_repository(@package_file)
  repository = ensure_resolved(repository)

  # Parse change mappings
  changes = parse_changes(options[:change])

  # Perform remapping
  remapped_repository = remap_prefixes(repository, changes)

  # Save to output file
  save_remapped_package(remapped_repository, options[:output])
end