Class: Lutaml::Xsd::Commands::StatsCommand::ShowCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Lutaml::Xsd::Commands::StatsCommand::ShowCommand
- Defined in:
- lib/lutaml/xsd/commands/stats_command.rb
Overview
Command class for showing repository statistics
Instance Attribute Summary
Attributes inherited from BaseCommand
Instance Method Summary collapse
-
#initialize(path, options = {}) ⇒ ShowCommand
constructor
A new instance of ShowCommand.
- #run ⇒ Object
Constructor Details
#initialize(path, options = {}) ⇒ ShowCommand
Returns a new instance of ShowCommand.
51 52 53 54 55 |
# File 'lib/lutaml/xsd/commands/stats_command.rb', line 51 def initialize(path, = {}) super() @path = path @format = [:format] || "text" end |
Instance Method Details
#run ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/lutaml/xsd/commands/stats_command.rb', line 57 def run repository = load_repository(@path) ensure_resolved(repository) stats = repository.statistics output_statistics(stats) rescue StandardError => e error("Failed to display statistics: #{e.}") verbose_output(e.backtrace.join("\n")) if verbose? exit 1 end |