Class: Lutaml::Xsd::Commands::PackageCommand::QuickCommand

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

Overview

Quick command implementation

Instance Attribute Summary

Attributes inherited from BaseCommand

#options

Instance Method Summary collapse

Constructor Details

#initialize(config_file, options) ⇒ QuickCommand

Returns a new instance of QuickCommand.



699
700
701
702
# File 'lib/lutaml/xsd/commands/package_command.rb', line 699

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

Instance Method Details

#runObject



704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
# File 'lib/lutaml/xsd/commands/package_command.rb', line 704

def run
  # Step 1: Build package
  output "" * 80
  output "Step 1: Building package"
  output "" * 80
  build_cmd = BuildCommand.new(@config_file, options)
  build_cmd.run
  output ""

  # Determine package path
  package_path = determine_package_path

  # Step 2: Validate (unless skipped)
  unless options[:no_validate]
    output "" * 80
    output "Step 2: Validating package"
    output "" * 80
    validate_options = options.dup
    validate_options[:format] = "text"
    validate_cmd = ValidateCommand.new(package_path, validate_options)
    validate_cmd.run
    output ""
  end

  # Step 3: Show stats (unless skipped)
  unless options[:no_stats]
    output "" * 80
    output "Step 3: Package statistics"
    output "" * 80
    require_relative "stats_command"
    stats_options = options.dup
    stats_options[:format] = "text"
    stats_cmd = StatsCommand::ShowCommand.new(
      package_path,
      stats_options,
    )
    stats_cmd.run
    output ""
  end

  output "" * 80
  output "✓ Quick workflow completed successfully"
  output "" * 80
rescue StandardError => e
  error "Quick workflow failed: #{e.message}"
  verbose_output e.backtrace.join("\n") if verbose?
  exit 1
end